Skip to content

Commit

Permalink
fix(dataZoom): data zoom length should take the handle icon width int…
Browse files Browse the repository at this point in the history
…o account apache#20686
  • Loading branch information
sz-p committed Jan 15, 2025
1 parent c09cab5 commit 5b7e92c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/component/dataZoom/SliderZoomView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,14 @@ class SliderZoomView extends DataZoomView {

// Position barGroup
const rect = thisGroup.getBoundingRect([sliderGroup]);
thisGroup.x = location.x - rect.x;
thisGroup.y = location.y - rect.y;
// there is only scaleX on sliderGroup.
thisGroup.scaleX = this._size[0] / rect.width;
// scaleY on sliderGroup is a bad idea.
// Because of the moveHandleSize maybe greater than zoom bar height.
// clip is better than scale hard.
const scaleY = this._size[1] / rect.height;
thisGroup.x = location.x - rect.x * thisGroup.scaleX;
thisGroup.y = location.y - rect.y * scaleY;
thisGroup.markRedraw();
}

Expand Down

0 comments on commit 5b7e92c

Please sign in to comment.