Skip to content

Commit

Permalink
fix(sheet): scrolling reaching limit judgment (#4473)
Browse files Browse the repository at this point in the history
Co-authored-by: Wubo Cao <[email protected]>
  • Loading branch information
wubocao and Wubo Cao authored Feb 6, 2025
1 parent 45a1c14 commit 4b3dd11
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export class SheetsScrollRenderController extends Disposable implements IRenderM

let offsetX = 0;
let offsetY = 0;
const isLimitedStore = viewMain.limitedScroll();

// what????
// const scrollNum = Math.abs(evt.deltaX);
Expand All @@ -98,6 +97,9 @@ export class SheetsScrollRenderController extends Disposable implements IRenderM
this._commandService.executeCommand(SetScrollRelativeCommand.id, { offsetX, offsetY });
this._context.scene.makeDirty(true);

// add offset on scroll position to check whether scrolling is reaching limit
const isLimitedStore = viewMain.limitedScroll(viewMain.scrollX + offsetX, viewMain.scrollY + offsetY);

// if viewport still have space to scroll, prevent default event. (DO NOT move canvas element)
// if scrolling is reaching limit, let scrolling event do the default behavior.
if (isLimitedStore && !isLimitedStore.isLimitedX && !isLimitedStore.isLimitedY) {
Expand Down

0 comments on commit 4b3dd11

Please sign in to comment.