@sequent-org/ifc-viewer 1.2.4-ci.58.0 → 1.2.4-ci.59.0
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequent-org/ifc-viewer",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.2.4-ci.
|
|
4
|
+
"version": "1.2.4-ci.59.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "IFC 3D model viewer component for web applications - fully self-contained with local IFCLoader",
|
|
7
7
|
"main": "src/index.js",
|
|
@@ -53,6 +53,8 @@ export class LabelPlacementController {
|
|
|
53
53
|
this._labelDrag = {
|
|
54
54
|
active: false,
|
|
55
55
|
moved: false,
|
|
56
|
+
// true => призрак живёт в document.body и позиционируется по viewport
|
|
57
|
+
ghostInBody: false,
|
|
56
58
|
pointerId: null,
|
|
57
59
|
id: null,
|
|
58
60
|
start: { x: 0, y: 0 },
|
|
@@ -615,6 +617,8 @@ export class LabelPlacementController {
|
|
|
615
617
|
const dragGhost = document.createElement("div");
|
|
616
618
|
dragGhost.className = "ifc-label-ghost ifc-label-ghost--drag";
|
|
617
619
|
dragGhost.setAttribute("aria-hidden", "true");
|
|
620
|
+
// Фиксируем позицию, чтобы призрак не обрезался контейнером viewer
|
|
621
|
+
dragGhost.style.position = "fixed";
|
|
618
622
|
dragGhost.style.display = "none";
|
|
619
623
|
dragGhost.style.left = "0px";
|
|
620
624
|
dragGhost.style.top = "0px";
|
|
@@ -673,7 +677,14 @@ export class LabelPlacementController {
|
|
|
673
677
|
// Важно: container должен быть position:relative (в index.html уже так).
|
|
674
678
|
this.container.appendChild(this._ui.btn);
|
|
675
679
|
this.container.appendChild(this._ui.ghost);
|
|
676
|
-
|
|
680
|
+
// Призрак перетаскивания добавляем в body, чтобы не обрезался overflow контейнера
|
|
681
|
+
if (document?.body) {
|
|
682
|
+
document.body.appendChild(this._ui.dragGhost);
|
|
683
|
+
this._labelDrag.ghostInBody = true;
|
|
684
|
+
} else {
|
|
685
|
+
this.container.appendChild(this._ui.dragGhost);
|
|
686
|
+
this._labelDrag.ghostInBody = false;
|
|
687
|
+
}
|
|
677
688
|
this.container.appendChild(this._ui.menu);
|
|
678
689
|
this.container.appendChild(this._ui.canvasMenu);
|
|
679
690
|
}
|
|
@@ -942,9 +953,13 @@ export class LabelPlacementController {
|
|
|
942
953
|
|
|
943
954
|
#updateDragGhostFromClient(clientX, clientY) {
|
|
944
955
|
this._labelDrag.last = { x: clientX, y: clientY };
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
956
|
+
let x = clientX;
|
|
957
|
+
let y = clientY;
|
|
958
|
+
if (!this._labelDrag.ghostInBody) {
|
|
959
|
+
if (!this._containerOffsetValid) this.#refreshContainerOffset();
|
|
960
|
+
x = (clientX - this._containerOffset.left);
|
|
961
|
+
y = (clientY - this._containerOffset.top);
|
|
962
|
+
}
|
|
948
963
|
this._labelDrag.ghostPos.x = x;
|
|
949
964
|
this._labelDrag.ghostPos.y = y;
|
|
950
965
|
this.#applyDragGhostTransform();
|
|
@@ -1008,6 +1023,11 @@ export class LabelPlacementController {
|
|
|
1008
1023
|
const moved = !!this._labelDrag.moved;
|
|
1009
1024
|
const clientX = e?.clientX ?? this._labelDrag.last.x;
|
|
1010
1025
|
const clientY = e?.clientY ?? this._labelDrag.last.y;
|
|
1026
|
+
this.logger?.log?.("[LabelClickDbg]", {
|
|
1027
|
+
phase: "finish",
|
|
1028
|
+
moved: !!moved,
|
|
1029
|
+
id: marker?.id ?? this._labelDrag.id,
|
|
1030
|
+
});
|
|
1011
1031
|
|
|
1012
1032
|
this._labelDrag.active = false;
|
|
1013
1033
|
this._labelDrag.moved = false;
|
|
@@ -1263,6 +1283,14 @@ export class LabelPlacementController {
|
|
|
1263
1283
|
this._markers.push(marker);
|
|
1264
1284
|
|
|
1265
1285
|
const onMarkerPointerDown = (e) => {
|
|
1286
|
+
this.logger?.log?.("[LabelClickDbg]", {
|
|
1287
|
+
phase: "down",
|
|
1288
|
+
button: e?.button,
|
|
1289
|
+
buttons: e?.buttons,
|
|
1290
|
+
clientX: e?.clientX,
|
|
1291
|
+
clientY: e?.clientY,
|
|
1292
|
+
pointerId: e?.pointerId,
|
|
1293
|
+
});
|
|
1266
1294
|
// Важно: не даём клику попасть в canvas/OrbitControls
|
|
1267
1295
|
try { e.preventDefault(); } catch (_) {}
|
|
1268
1296
|
try { e.stopPropagation(); } catch (_) {}
|
|
@@ -1281,6 +1309,14 @@ export class LabelPlacementController {
|
|
|
1281
1309
|
try { marker.el.addEventListener("pointerdown", onMarkerPointerDown); } catch (_) {}
|
|
1282
1310
|
}
|
|
1283
1311
|
const onMarkerPointerUp = (e) => {
|
|
1312
|
+
this.logger?.log?.("[LabelClickDbg]", {
|
|
1313
|
+
phase: "up",
|
|
1314
|
+
button: e?.button,
|
|
1315
|
+
buttons: e?.buttons,
|
|
1316
|
+
clientX: e?.clientX,
|
|
1317
|
+
clientY: e?.clientY,
|
|
1318
|
+
pointerId: e?.pointerId,
|
|
1319
|
+
});
|
|
1284
1320
|
};
|
|
1285
1321
|
try { marker.el.addEventListener("pointerup", onMarkerPointerUp, { capture: true, passive: true }); } catch (_) {
|
|
1286
1322
|
try { marker.el.addEventListener("pointerup", onMarkerPointerUp); } catch (_) {}
|