@sequent-org/moodboard 1.2.71 → 1.2.72
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 +1 -1
- package/src/core/index.js +12 -0
- package/src/services/SettingsApplier.js +10 -0
package/package.json
CHANGED
package/src/core/index.js
CHANGED
|
@@ -574,6 +574,13 @@ export class CoreMoodBoard {
|
|
|
574
574
|
stage.x += delta.x;
|
|
575
575
|
stage.y += delta.y;
|
|
576
576
|
}
|
|
577
|
+
// Сообщаем системе об обновлении позиции мира для автосохранения
|
|
578
|
+
try {
|
|
579
|
+
const world = this.pixi.worldLayer || this.pixi.app.stage;
|
|
580
|
+
this.eventBus.emit(Events.Grid.BoardDataChanged, {
|
|
581
|
+
settings: { pan: { x: world.x || 0, y: world.y || 0 } }
|
|
582
|
+
});
|
|
583
|
+
} catch (_) {}
|
|
577
584
|
});
|
|
578
585
|
|
|
579
586
|
// Миникарта перенесена в BoardService
|
|
@@ -2167,6 +2174,10 @@ export class CoreMoodBoard {
|
|
|
2167
2174
|
};
|
|
2168
2175
|
const world = this.pixi?.worldLayer || app?.stage;
|
|
2169
2176
|
const currentZoom = Math.max(0.1, Math.min(5, world?.scale?.x || 1));
|
|
2177
|
+
const currentPan = {
|
|
2178
|
+
x: (world?.x ?? 0),
|
|
2179
|
+
y: (world?.y ?? 0)
|
|
2180
|
+
};
|
|
2170
2181
|
const canvasW = app?.view?.clientWidth || app?.view?.width || 0;
|
|
2171
2182
|
const canvasH = app?.view?.clientHeight || app?.view?.height || 0;
|
|
2172
2183
|
|
|
@@ -2191,6 +2202,7 @@ export class CoreMoodBoard {
|
|
|
2191
2202
|
backgroundColor: toHex(rendererBg ?? 0xF5F5F5),
|
|
2192
2203
|
grid: gridSettings || undefined,
|
|
2193
2204
|
zoom: { min: 0.1, max: 5.0, default: 1.0, current: currentZoom },
|
|
2205
|
+
pan: currentPan,
|
|
2194
2206
|
canvas: { width: canvasW, height: canvasH }
|
|
2195
2207
|
};
|
|
2196
2208
|
|
|
@@ -70,6 +70,16 @@ export class SettingsApplier {
|
|
|
70
70
|
try { this.eventBus.emit(Events.UI.ZoomPercent, { percentage: Math.round(z * 100) }); } catch (_) {}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
+
|
|
74
|
+
// 4) Панорамирование (позиция мира)
|
|
75
|
+
if (s.pan && typeof s.pan.x === 'number' && typeof s.pan.y === 'number') {
|
|
76
|
+
const world = this.pixi?.worldLayer || this.pixi?.app?.stage;
|
|
77
|
+
if (world) {
|
|
78
|
+
world.x = s.pan.x;
|
|
79
|
+
world.y = s.pan.y;
|
|
80
|
+
// Обновление зависимых слоёв/панелей выполняется по их событиям; здесь только применяем позицию
|
|
81
|
+
}
|
|
82
|
+
}
|
|
73
83
|
}
|
|
74
84
|
|
|
75
85
|
_toIntColor(hexOrInt) {
|