feat(resize): Optimize resizing process and maintain zoom level (#3889)

This commit is contained in:
Alireza authored and GitHub committed 2024-02-21 13:49:23 -05:00
1 parent a2a0090eeb
commit b3a0faf5f5
37 files changed
+1395 -968

No files matched your search

+2
View File
@@ -22,6 +22,8 @@
"yarn": ">=1.16.0"
},
"scripts": {
"clean": "shx rm -rf dist",
"clean:deep": "yarn run clean && shx rm -rf node_modules",
"dev": "jest --watchAll",
"dev:core": "yarn run dev",
"build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js",
@@ -6,6 +6,7 @@ class ViewportGridService extends PubSubService {
ACTIVE_VIEWPORT_ID_CHANGED: 'event::activeviewportidchanged',
LAYOUT_CHANGED: 'event::layoutChanged',
GRID_STATE_CHANGED: 'event::gridStateChanged',
GRID_SIZE_CHANGED: 'event::gridSizeChanged',
};
public static REGISTRATION = {
@@ -64,7 +65,6 @@ class ViewportGridService extends PubSubService {
public setActiveViewportId(id: string) {
this.serviceImplementation._setActiveViewport(id);
const state = this.getState();
this._broadcastEvent(this.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED, {
viewportId: id,
});
@@ -79,6 +79,13 @@ class ViewportGridService extends PubSubService {
return state.activeViewportId;
}
public setViewportGridSizeChanged() {
const state = this.getState();
this._broadcastEvent(this.EVENTS.GRID_SIZE_CHANGED, {
state,
});
}
public setDisplaySetsForViewport(props) {
// Just update a single viewport, but use the multi-viewport update for it.
this.setDisplaySetsForViewports([props]);