Skip to content

Commit

Permalink
Merge pull request #74 from devexperts/fix-studies-linewidth-change
Browse files Browse the repository at this point in the history
fix: show correctly hovered width of dataseries which can be configur…
  • Loading branch information
KirillBobkov authored Nov 13, 2023
2 parents 1fe82e1 + 1379311 commit c333355
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/chart/drawers/data-series.drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ export class DataSeriesDrawer implements DynamicModelDrawer<DataSeriesModel> {
const paintTool = series.config.type;
const drawer = this.seriesDrawers[paintTool];
if (drawer) {
const viewportSeries = series.getSeriesInViewport(
series.scale.xStart - 1,
series.scale.xEnd + 1,
);
const viewportSeries = series.getSeriesInViewport(series.scale.xStart - 1, series.scale.xEnd + 1);
if (viewportSeries && viewportSeries.length >= 1) {
// +- 1 to correctly draw points which are partly inside bounds
drawer.draw(ctx, viewportSeries, series, {});
Expand Down Expand Up @@ -89,7 +86,7 @@ export const setLineWidth = (
if (drawerConfig.forceBold) {
ctx.lineWidth = drawerConfig.forceBold;
} else if (dataSeries.hovered) {
ctx.lineWidth = seriesSelectedWidth;
ctx.lineWidth = lineWidth !== seriesSelectedWidth ? lineWidth + 1 : seriesSelectedWidth;
} else {
ctx.lineWidth = lineWidth;
}
Expand Down

0 comments on commit c333355

Please sign in to comment.