@sequent-org/moodboard 1.4.49 → 1.4.51

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.
@@ -25,6 +25,12 @@ export function handleObjectSelect(objectId, event) {
25
25
  }
26
26
 
27
27
  export function startDrag(objectId, event) {
28
+ const req = { objectId, pixiObject: null };
29
+ this.emit('tool:get:object:pixi', req);
30
+ if (req.pixiObject?._mb?.properties?.locked) {
31
+ return;
32
+ }
33
+
28
34
  this.isDragging = true;
29
35
  this.dragTarget = objectId;
30
36
  // Сообщаем HtmlHandlesLayer о начале перетаскивания одиночного объекта
@@ -91,6 +97,23 @@ export function endDrag() {
91
97
  }
92
98
 
93
99
  export function startResize(handle, objectId) {
100
+ const isLocked = (() => {
101
+ if (objectId === this.groupId) {
102
+ return this.selection.toArray().some(id => {
103
+ const req = { objectId: id, pixiObject: null };
104
+ this.emit('tool:get:object:pixi', req);
105
+ return !!req.pixiObject?._mb?.properties?.locked;
106
+ });
107
+ }
108
+ const req = { objectId, pixiObject: null };
109
+ this.emit('tool:get:object:pixi', req);
110
+ return !!req.pixiObject?._mb?.properties?.locked;
111
+ })();
112
+
113
+ if (isLocked) {
114
+ return;
115
+ }
116
+
94
117
  // Групповой resize
95
118
  if (objectId === this.groupId && this.selection.size() > 1) {
96
119
  this.isGroupResizing = true;
@@ -169,6 +192,23 @@ export function endResize() {
169
192
  }
170
193
 
171
194
  export function startRotate(objectId) {
195
+ const isLocked = (() => {
196
+ if (objectId === this.groupId) {
197
+ return this.selection.toArray().some(id => {
198
+ const req = { objectId: id, pixiObject: null };
199
+ this.emit('tool:get:object:pixi', req);
200
+ return !!req.pixiObject?._mb?.properties?.locked;
201
+ });
202
+ }
203
+ const req = { objectId, pixiObject: null };
204
+ this.emit('tool:get:object:pixi', req);
205
+ return !!req.pixiObject?._mb?.properties?.locked;
206
+ })();
207
+
208
+ if (isLocked) {
209
+ return;
210
+ }
211
+
172
212
  // Групповой поворот
173
213
  if (objectId === this.groupId && this.selection.size() > 1) {
174
214
  this.isGroupRotating = true;
@@ -276,6 +316,16 @@ export function endBoxSelect() {
276
316
  }
277
317
 
278
318
  export function startGroupDrag(event) {
319
+ const isLocked = this.selection.toArray().some(id => {
320
+ const req = { objectId: id, pixiObject: null };
321
+ this.emit('tool:get:object:pixi', req);
322
+ return !!req.pixiObject?._mb?.properties?.locked;
323
+ });
324
+
325
+ if (isLocked) {
326
+ return;
327
+ }
328
+
279
329
  const gb = this.computeGroupBounds();
280
330
  this.groupStartBounds = gb;
281
331
  this.isGroupDragging = true;