Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sheet): render viewport wrong size #1727

Draft
wants to merge 13 commits into
base: dev
Choose a base branch
from
Prev Previous commit
Next Next commit
fix: new viewport need more param
  • Loading branch information
lumixraku committed May 24, 2024
commit 00271716e0e1ece6e9c3265ea99b4af8c8f3591c
2 changes: 2 additions & 0 deletions packages/slides/src/views/render/adaptors/docs-adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export class DocsAdaptor extends ObjectAdaptor {
top: 0,
bottom: 0,
right: 0,
isRelativeX: true,
isRelativeY: true,
isWheelPreventDefaultX: true,
});

Expand Down
2 changes: 2 additions & 0 deletions packages/slides/src/views/render/adaptors/slide-adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ export class SlideAdaptor extends ObjectAdaptor {
top: 0,
bottom: 0,
right: 0,
isRelativeX: true,
isRelativeY: true,
});

viewMain.closeClip();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,16 @@ export class SpreadsheetAdaptor extends ObjectAdaptor {
top: columnHeaderHeightScale,
bottom: 0,
right: 0,
isRelativeX: true,
isRelativeY: true,
isWheelPreventDefaultX: true,
});
const viewTop = new Viewport(SHEET_VIEW_KEY.VIEW_TOP + id, scene, {
left: rowHeaderWidthScale,
height: columnHeaderHeightScale,
top: 0,
right: 0,
isRelativeX: true,
isWheelPreventDefaultX: true,
});
const viewLeft = new Viewport(SHEET_VIEW_KEY.VIEW_LEFT + id, scene, {
Expand Down
5 changes: 5 additions & 0 deletions packages/slides/src/views/render/canvas-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export class CanvasView extends RxDisposable {
return this._renderManagerService.getRenderById(slideDataModel.getUnitId());
}

// eslint-disable-next-line max-lines-per-function
private _addNewRender(unitId: string) {
const slideDataModel = this._univerInstanceService.getUnit<SlideDataModel>(unitId, UniverInstanceType.UNIVER_SLIDE);

Expand Down Expand Up @@ -175,6 +176,8 @@ export class CanvasView extends RxDisposable {
top: 0,
bottom: 0,
right: 0,
isRelativeX: true,
isRelativeY: true,
isWheelPreventDefaultX: true,
});

Expand Down Expand Up @@ -412,6 +415,8 @@ export class CanvasView extends RxDisposable {
top: 0,
bottom: 0,
right: 0,
isRelativeX: true,
isRelativeY: true,
});

viewMain.closeClip();
Expand Down