@xeokit/xeokit-sdk 2.5.2-beta-7 → 2.5.2-beta-9
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/dist/xeokit-sdk.cjs.js +42 -20
- package/dist/xeokit-sdk.es.js +138 -116
- package/dist/xeokit-sdk.es5.js +8 -6
- package/dist/xeokit-sdk.min.cjs.js +5 -5
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +4 -4
- package/package.json +1 -1
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.js +7 -2
- package/src/plugins/AnnotationsPlugin/Annotation.js +2 -2
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.js +9 -2
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV11.js +663 -0
- package/src/viewer/scene/core.js +24 -14
- package/types/viewer/scene/models/SceneModel.d.ts +46 -48
package/package.json
CHANGED
|
@@ -218,8 +218,13 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
218
218
|
mouseHoverCanvasPos.set(canvasPos);
|
|
219
219
|
switch (this._mouseState) {
|
|
220
220
|
case MOUSE_FINDING_ORIGIN:
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
const canvasBoundRect = canvas.getBoundingClientRect();
|
|
222
|
+
const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
|
|
223
|
+
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
224
|
+
const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
|
|
225
|
+
const canvasTopEdge = canvasBoundRect.top + scrollTop;
|
|
226
|
+
this._markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
|
|
227
|
+
this._markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;
|
|
223
228
|
break;
|
|
224
229
|
case MOUSE_FINDING_CORNER:
|
|
225
230
|
if (this._currentAngleMeasurement) {
|
|
@@ -151,7 +151,7 @@ class Annotation extends Marker {
|
|
|
151
151
|
if (utils.isArray(markerHTML)) {
|
|
152
152
|
markerHTML = markerHTML.join("");
|
|
153
153
|
}
|
|
154
|
-
markerHTML = this._renderTemplate(markerHTML);
|
|
154
|
+
markerHTML = this._renderTemplate(markerHTML.trim());
|
|
155
155
|
const markerFragment = document.createRange().createContextualFragment(markerHTML);
|
|
156
156
|
this._marker = markerFragment.firstChild;
|
|
157
157
|
this._container.appendChild(this._marker);
|
|
@@ -178,7 +178,7 @@ class Annotation extends Marker {
|
|
|
178
178
|
if (utils.isArray(labelHTML)) {
|
|
179
179
|
labelHTML = labelHTML.join("");
|
|
180
180
|
}
|
|
181
|
-
labelHTML = this._renderTemplate(labelHTML);
|
|
181
|
+
labelHTML = this._renderTemplate(labelHTML.trim());
|
|
182
182
|
const labelFragment = document.createRange().createContextualFragment(labelHTML);
|
|
183
183
|
this._label = labelFragment.firstChild;
|
|
184
184
|
this._container.appendChild(this._label);
|
|
@@ -204,8 +204,15 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
|
|
|
204
204
|
pointerWorldPos.set(event.worldPos);
|
|
205
205
|
pointerCanvasPos.set(event.canvasPos);
|
|
206
206
|
if (this._mouseState === MOUSE_FIRST_CLICK_EXPECTED) {
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
|
|
208
|
+
const canvasBoundRect = canvas.getBoundingClientRect();
|
|
209
|
+
const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
|
|
210
|
+
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
211
|
+
const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
|
|
212
|
+
const canvasTopEdge = canvasBoundRect.top + scrollTop;
|
|
213
|
+
|
|
214
|
+
this._markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
|
|
215
|
+
this._markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;
|
|
209
216
|
this._markerDiv.style.background = "pink";
|
|
210
217
|
if (event.snappedToVertex || event.snappedToEdge) {
|
|
211
218
|
if (this.pointerLens) {
|