Skip to content

Commit

Permalink
Merge pull request #113 from devexperts/yaxis-scale-handler-autoscale
Browse files Browse the repository at this point in the history
fix: don't trigger yScale subject if scale didn't change
  • Loading branch information
KirillBobkov authored Dec 20, 2023
2 parents 3e7c27b + f9b384f commit d206bc0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/chart/components/y_axis/y-axis-scale.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ export class YAxisScaleHandler extends ChartBaseElement {
const newYStart = this.lastYStart - delta;
const newYEnd = this.lastYEnd + delta;
this.autoScaleCallback(false);
this.scale.setYScale(newYStart, newYEnd);
this.bus.fireDraw();
if (this.lastYStart !== newYStart || this.lastYEnd !== newYEnd) {
this.scale.setYScale(newYStart, newYEnd);
this.bus.fireDraw();
}
};

private onYDragEnd = () => {
Expand Down

0 comments on commit d206bc0

Please sign in to comment.