polarvo-layout 1.0.47 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -177,7 +177,7 @@ class EngineManager {
|
|
|
177
177
|
console.warn('[EngineManager] baseLayout 요소를 찾을 수 없습니다.');
|
|
178
178
|
return false;
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
const { width, height } = containerEl.getBoundingClientRect();
|
|
182
182
|
const newHeight = width / calculateAspectRatio(this._displaySize.aspectRatio);
|
|
183
183
|
|
|
@@ -269,26 +269,28 @@ class EngineManager {
|
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
_updateElementsScale(oldValue, newValue) {
|
|
272
|
+
async _updateElementsScale(oldValue, newValue) {
|
|
273
273
|
const oldWidth = oldValue.px;
|
|
274
274
|
const oldHeight = oldValue.px / calculateAspectRatio(oldValue.aspectRatio);
|
|
275
275
|
|
|
276
276
|
const newWidth = newValue.px;
|
|
277
277
|
const newHeight = newValue.px / calculateAspectRatio(newValue.aspectRatio);
|
|
278
278
|
|
|
279
|
-
nextTick(
|
|
280
|
-
|
|
279
|
+
await nextTick();
|
|
280
|
+
// nextTick(() => {
|
|
281
|
+
this.setContainerSize();
|
|
281
282
|
|
|
282
|
-
|
|
283
|
-
|
|
283
|
+
const normalizeElements = dataConverter.normalize(this.state.elements, oldWidth, oldHeight);
|
|
284
|
+
const denormalizedElements = dataConverter.denormalize(normalizeElements, newWidth, newHeight);
|
|
284
285
|
|
|
285
|
-
|
|
286
|
+
// this.state.elements = denormalizedElements;
|
|
287
|
+
this.state.elements.splice(0, this.state.elements.length, ...denormalizedElements);
|
|
286
288
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
});
|
|
289
|
+
this.eventBus.emit('system:requestElementsScale', {
|
|
290
|
+
$elements: this.state.elements,
|
|
291
|
+
timestamp: Date.now(),
|
|
291
292
|
});
|
|
293
|
+
// });
|
|
292
294
|
}
|
|
293
295
|
|
|
294
296
|
/** ---------------------------------- layout Engine ---------------------------------- **/
|
|
@@ -383,6 +385,7 @@ class EngineManager {
|
|
|
383
385
|
size: { ...el.size, h: el.size.h * scaleFactor },
|
|
384
386
|
};
|
|
385
387
|
});
|
|
388
|
+
console.log('element', this.state.elements);
|
|
386
389
|
|
|
387
390
|
// nextTick(() => {
|
|
388
391
|
this.eventBus.emit('system:requestElementsScale', {
|
|
@@ -81,7 +81,8 @@ function useFreeDrop(api) {
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
_subscribe('system:requestElementsScale', ({ $elements, guides }) => {
|
|
84
|
-
state.elements = [...$elements];
|
|
84
|
+
// state.elements = [...$elements];
|
|
85
|
+
state.elements.splice(0, state.elements.length, ...$elements);
|
|
85
86
|
state.guides = guides ?? { x: null, y: null, w: null, h: null };
|
|
86
87
|
});
|
|
87
88
|
|
|
@@ -68,7 +68,8 @@ function useGridDrop(api) {
|
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
_subscribe('system:requestElementsScale', ({ $elements }) => {
|
|
71
|
-
state.elements = $elements;
|
|
71
|
+
// state.elements = $elements;
|
|
72
|
+
state.elements.splice(0, state.elements.length, ...$elements);
|
|
72
73
|
});
|
|
73
74
|
|
|
74
75
|
_subscribe('gridDrop:requestUpdateLocalBounds', ({ elementId, position, size }) => {
|
|
@@ -113,7 +113,8 @@ function useLayout(api) {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
_subscribe('system:requestElementsScale', ({ $elements }) => {
|
|
116
|
-
state.elements = $elements;
|
|
116
|
+
// state.elements = $elements;
|
|
117
|
+
state.elements.splice(0, state.elements.length, ...$elements);
|
|
117
118
|
});
|
|
118
119
|
|
|
119
120
|
_subscribe('system:restoredState', ({ domain, state: snapShot }) => {
|