@inweb/viewer-three 26.10.4 → 26.10.5

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.
@@ -1126,12 +1126,14 @@ class MeasureSnapper {
1126
1126
  class MeasureOverlay {
1127
1127
  constructor(camera, canvas) {
1128
1128
  this.lines = [];
1129
- this.resizeContainer = (entries) => {
1130
- const { width, height } = entries[0].contentRect;
1131
- if (!width || !height)
1129
+ this.resizeContainer = () => {
1130
+ const { offsetLeft, offsetTop, offsetWidth, offsetHeight } = this.canvas;
1131
+ if (!offsetWidth || !offsetHeight)
1132
1132
  return;
1133
- this.container.style.width = `${width}px`;
1134
- this.container.style.height = `${height}px`;
1133
+ this.container.style.left = `${offsetLeft}px`;
1134
+ this.container.style.top = `${offsetTop}px`;
1135
+ this.container.style.width = `${offsetWidth}px`;
1136
+ this.container.style.height = `${offsetHeight}px`;
1135
1137
  };
1136
1138
  this.camera = camera;
1137
1139
  this.canvas = canvas;
@@ -1148,7 +1150,7 @@ class MeasureOverlay {
1148
1150
  if (!this.canvas.parentElement)
1149
1151
  return;
1150
1152
  this.canvas.parentElement.appendChild(this.container);
1151
- this.resizeObserver.observe(this.canvas.parentElement);
1153
+ this.resizeObserver.observe(this.canvas);
1152
1154
  }
1153
1155
  dispose() {
1154
1156
  this.clear();