mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
refactor(editor): enable forceUpdate by default in viewport apis (#11264)
In this way, all downstream callers can be guaranteed by correct viewport fit result, instead of requiring them to set `forceUpdate: true` param explicitly to them. The resizing optimization is an internal exception.
This commit is contained in:
@@ -90,7 +90,7 @@ export function patchForEdgelessNoteConfig(
|
||||
]);
|
||||
|
||||
const center = Vec.sub(edgelessTitleAnchor, pageTitleAnchor);
|
||||
gfx.viewport.setCenter(center[0], center[1], true);
|
||||
gfx.viewport.setCenter(center[0], center[1]);
|
||||
gfx.viewport.smoothZoom(0.65, undefined, 15);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -58,8 +58,7 @@ function fitViewport(
|
||||
viewport.setViewportByBound(
|
||||
Bound.deserialize(newViewport.xywh),
|
||||
newViewport.padding,
|
||||
false,
|
||||
true
|
||||
false
|
||||
);
|
||||
} else {
|
||||
gfx.fitToScreen({
|
||||
|
||||
Reference in New Issue
Block a user