@sequent-org/moodboard 1.0.15 → 1.0.16
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
|
@@ -525,23 +525,35 @@ export class SelectTool extends BaseTool {
|
|
|
525
525
|
|
|
526
526
|
// Сначала ищем в контейнере ручек (приоритет)
|
|
527
527
|
if (this.resizeHandles.container && this.resizeHandles.container.visible) {
|
|
528
|
-
|
|
529
|
-
|
|
528
|
+
const container = this.resizeHandles.container;
|
|
529
|
+
if (!container || !container.children) return null;
|
|
530
|
+
|
|
531
|
+
for (let i = container.children.length - 1; i >= 0; i--) {
|
|
532
|
+
const child = container.children[i];
|
|
530
533
|
|
|
531
534
|
// Проверяем обычные объекты
|
|
532
|
-
if (child.containsPoint && child.containsPoint
|
|
533
|
-
|
|
534
|
-
|
|
535
|
+
if (child && child.containsPoint && typeof child.containsPoint === 'function') {
|
|
536
|
+
try {
|
|
537
|
+
if (child.containsPoint(point)) {
|
|
538
|
+
return child;
|
|
539
|
+
}
|
|
540
|
+
} catch (error) {
|
|
541
|
+
// Игнорируем ошибки containsPoint
|
|
542
|
+
}
|
|
535
543
|
}
|
|
536
544
|
|
|
537
545
|
// Специальная проверка для контейнеров (ручка вращения)
|
|
538
|
-
if (child instanceof PIXI.Container && child.children.length > 0) {
|
|
546
|
+
if (child instanceof PIXI.Container && child.children && child.children.length > 0) {
|
|
539
547
|
// Проверяем границы контейнера
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
point.
|
|
548
|
+
try {
|
|
549
|
+
const bounds = child.getBounds();
|
|
550
|
+
if (bounds && point.x >= bounds.x && point.x <= bounds.x + bounds.width &&
|
|
551
|
+
point.y >= bounds.y && point.y <= bounds.y + bounds.height) {
|
|
543
552
|
|
|
544
|
-
|
|
553
|
+
return child;
|
|
554
|
+
}
|
|
555
|
+
} catch (error) {
|
|
556
|
+
// Игнорируем ошибки getBounds
|
|
545
557
|
}
|
|
546
558
|
}
|
|
547
559
|
}
|
|
@@ -549,11 +561,19 @@ export class SelectTool extends BaseTool {
|
|
|
549
561
|
|
|
550
562
|
// Затем ищем в основной сцене
|
|
551
563
|
const stage = this.resizeHandles.app.stage;
|
|
564
|
+
if (!stage || !stage.children) return null;
|
|
565
|
+
|
|
552
566
|
for (let i = stage.children.length - 1; i >= 0; i--) {
|
|
553
567
|
const child = stage.children[i];
|
|
554
|
-
if (this.resizeHandles.container && child !== this.resizeHandles.container &&
|
|
555
|
-
|
|
556
|
-
|
|
568
|
+
if (this.resizeHandles.container && child && child !== this.resizeHandles.container &&
|
|
569
|
+
child.containsPoint && typeof child.containsPoint === 'function') {
|
|
570
|
+
try {
|
|
571
|
+
if (child.containsPoint(point)) {
|
|
572
|
+
return child;
|
|
573
|
+
}
|
|
574
|
+
} catch (error) {
|
|
575
|
+
// Игнорируем ошибки containsPoint
|
|
576
|
+
}
|
|
557
577
|
}
|
|
558
578
|
}
|
|
559
579
|
|