3dtiles-inspector 0.2.2 → 0.2.4

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,6 +1,6 @@
1
1
  {
2
2
  "name": "3dtiles-inspector",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Inspect, align, and save local 3D Tiles root transforms in an interactive browser session.",
5
5
  "author": "William Liu <lyz15972107087@gmail.com>",
6
6
  "license": "Apache-2.0",
@@ -147,11 +147,120 @@ function buildViewerHtml(viewerConfig) {
147
147
  .screen-selection-rect {
148
148
  position: absolute;
149
149
  border: 1px solid #ffcf33;
150
- background: rgba(255, 207, 51, 0.14);
150
+ background: rgba(255, 207, 51, 0.06);
151
151
  box-shadow:
152
152
  0 8px 24px rgba(120, 82, 0, 0.12);
153
153
  }
154
154
 
155
+ .screen-selection-rect.editable {
156
+ border: 0;
157
+ background: transparent;
158
+ box-shadow: none;
159
+ }
160
+
161
+ .screen-selection-edit-svg {
162
+ position: absolute;
163
+ inset: 0;
164
+ display: none;
165
+ overflow: visible;
166
+ }
167
+
168
+ .screen-selection-rect.editable .screen-selection-edit-svg {
169
+ display: block;
170
+ }
171
+
172
+ .screen-selection-edit-polygon {
173
+ fill: rgba(255, 207, 51, 0.06);
174
+ stroke: #ffcf33;
175
+ stroke-width: 2;
176
+ vector-effect: non-scaling-stroke;
177
+ filter: drop-shadow(0 8px 12px rgba(120, 82, 0, 0.12));
178
+ }
179
+
180
+ .screen-selection-rect.editable.drawing .screen-selection-edit-polygon {
181
+ fill: rgba(255, 207, 51, 0.2);
182
+ }
183
+
184
+ .screen-selection-edit-grid line {
185
+ stroke: rgba(255, 255, 255, 0.72);
186
+ stroke-width: 0.6;
187
+ vector-effect: non-scaling-stroke;
188
+ }
189
+
190
+ .screen-selection-edit-handle {
191
+ position: absolute;
192
+ display: none;
193
+ pointer-events: none;
194
+ transform: translate(-50%, -50%);
195
+ transform-origin: center;
196
+ }
197
+
198
+ .screen-selection-edit-handle::before {
199
+ content: "";
200
+ position: absolute;
201
+ inset: 0;
202
+ display: block;
203
+ box-sizing: border-box;
204
+ transform-origin: center;
205
+ scale: 1;
206
+ transition: scale 80ms ease;
207
+ }
208
+
209
+ .screen-selection-rect.editable .screen-selection-edit-handle {
210
+ display: block;
211
+ }
212
+
213
+ .screen-selection-edit-top-left,
214
+ .screen-selection-edit-top-right,
215
+ .screen-selection-edit-bottom-right,
216
+ .screen-selection-edit-bottom-left {
217
+ width: 10px;
218
+ height: 10px;
219
+ }
220
+
221
+ .screen-selection-edit-top-left::before,
222
+ .screen-selection-edit-top-right::before,
223
+ .screen-selection-edit-bottom-right::before,
224
+ .screen-selection-edit-bottom-left::before {
225
+ border: 2px solid #ffffff;
226
+ border-radius: 50%;
227
+ background: #ffcf33;
228
+ box-shadow: 0 2px 8px rgba(120, 82, 0, 0.28);
229
+ }
230
+
231
+ .screen-selection-edit-top-left.active::before,
232
+ .screen-selection-edit-top-right.active::before,
233
+ .screen-selection-edit-bottom-right.active::before,
234
+ .screen-selection-edit-bottom-left.active::before {
235
+ scale: 1.5;
236
+ }
237
+
238
+ .screen-selection-edit-top,
239
+ .screen-selection-edit-right,
240
+ .screen-selection-edit-bottom,
241
+ .screen-selection-edit-left {
242
+ width: 26px;
243
+ height: 4px;
244
+ }
245
+
246
+ .screen-selection-edit-top::before,
247
+ .screen-selection-edit-right::before,
248
+ .screen-selection-edit-bottom::before,
249
+ .screen-selection-edit-left::before {
250
+ border-radius: 999px;
251
+ background: #ffffff;
252
+ box-shadow: 0 1px 6px rgba(120, 82, 0, 0.24);
253
+ }
254
+
255
+ .screen-selection-edit-top.active::before,
256
+ .screen-selection-edit-right.active::before,
257
+ .screen-selection-edit-bottom.active::before,
258
+ .screen-selection-edit-left.active::before {
259
+ scale:
260
+ var(--screen-selection-edit-active-scale-x, 1.28)
261
+ var(--screen-selection-edit-active-scale-y, 1.5);
262
+ }
263
+
155
264
  .toolbar-dock {
156
265
  position: fixed;
157
266
  top: 14px;
@@ -743,13 +852,13 @@ function buildViewerHtml(viewerConfig) {
743
852
  <p id="crop-count-value" class="toolbar-value">0</p>
744
853
  </div>
745
854
  <div class="coordinate-actions">
746
- <button id="crop-screen-select" class="wide" type="button">Select Region</button>
855
+ <button id="crop-screen-select" class="wide" type="button">Draw Region</button>
747
856
  </div>
748
- <div id="crop-list" class="crop-list"></div>
749
857
  <div class="status-actions">
750
858
  <button id="crop-screen-confirm" type="button">Confirm</button>
751
859
  <button id="crop-screen-cancel" type="button">Cancel</button>
752
860
  </div>
861
+ <div id="crop-list" class="crop-list"></div>
753
862
  </div>
754
863
  </div>
755
864
  <div class="toolbar-section status-panel">
package/src/viewer/app.js CHANGED
@@ -193,7 +193,7 @@ function setSaveUiLocked(locked) {
193
193
  }
194
194
 
195
195
  cameraController.setPointerDownFilter((event) => {
196
- return !(cropController?.getPendingMode() && event.button === 0);
196
+ return !(cropController?.shouldCapturePointerDown(event) ?? false);
197
197
  });
198
198
 
199
199
  const { transformControls, transformControlsHelper } =
@@ -469,9 +469,13 @@ function loadTileset(url, { frameOnLoad = true } = {}) {
469
469
  if (framed) {
470
470
  return;
471
471
  }
472
- if (flyTo.frameTileset()) {
472
+ if (
473
+ flyTo.frameTileset({
474
+ activeStatus: 'Framing tileset...',
475
+ doneStatus: 'Tileset ready.',
476
+ })
477
+ ) {
473
478
  framed = true;
474
- setStatus('Tileset ready.');
475
479
  }
476
480
  };
477
481
 
@@ -602,6 +606,7 @@ loadTileset(TILESET_URL);
602
606
 
603
607
  function frame() {
604
608
  cameraController.update();
609
+ flyTo.update();
605
610
  rootTransform.flush();
606
611
  globeController.update();
607
612
  tiles?.update();