floor-editor-ts 1.4.7 → 1.4.8

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.
@@ -11309,10 +11309,9 @@ function drawZoneShape(cs, zone, selected) {
11309
11309
  ctx.fillStyle = color;
11310
11310
  ctx.fillText(zone.name, bx + 6, by + 4);
11311
11311
  }
11312
- const r = selected ? 9 : 7;
11313
- for (let i = 0; i < pts.length; i++) {
11312
+ if (selected) for (let i = 0; i < pts.length; i++) {
11314
11313
  const s = wts(cs, pts[i].x, pts[i].y);
11315
- drawVertexIndexBadge(ctx, s.x, s.y, i, color, r);
11314
+ drawVertexIndexBadge(ctx, s.x, s.y, i, color, 9);
11316
11315
  }
11317
11316
  ctx.restore();
11318
11317
  }
@@ -63830,7 +63829,7 @@ function CameraFovEditor($$anchor, $$props) {
63830
63829
  ctx.setLineDash([]);
63831
63830
  ctx.globalAlpha = 1;
63832
63831
  }
63833
- for (let i = 0; i < placed.length; i++) drawVertexIndexBadge(ctx, placed[i].x * s, placed[i].y * s, i, color, 10);
63832
+ if (get(editing) || get(polySelected)) for (let i = 0; i < placed.length; i++) drawVertexIndexBadge(ctx, placed[i].x * s, placed[i].y * s, i, color, 10);
63834
63833
  ctx.restore();
63835
63834
  }
63836
63835
  }
@@ -67241,18 +67240,18 @@ function FloorPlanCanvas($$anchor, $$props) {
67241
67240
  for (const fi of get(currentFloor).furniture) {
67242
67241
  var _fi$props2, _fi$props3;
67243
67242
  if (fi.catalogId !== "camera" || !fi.serial) continue;
67243
+ if (!(get(selectedFovSerial) === fi.serial || get(currentSelectedId) === fi.id)) continue;
67244
67244
  const mapStr = (_fi$props2 = fi.props) === null || _fi$props2 === void 0 ? void 0 : _fi$props2.mapCoordinates;
67245
67245
  if (!mapStr) continue;
67246
67246
  const pts = mapCoordinatesToWorldPoints(mapStr, bounds);
67247
67247
  if (pts.length < 2) continue;
67248
- const isActive = get(selectedFovSerial) === fi.serial || (active === null || active === void 0 ? void 0 : active.id) === fi.id;
67249
67248
  const color = ((_fi$props3 = fi.props) === null || _fi$props3 === void 0 ? void 0 : _fi$props3.zoneColor) || fi.color || "#22c55e";
67250
67249
  ctx.save();
67251
67250
  ctx.strokeStyle = color;
67252
67251
  ctx.fillStyle = color;
67253
- ctx.globalAlpha = isActive ? .22 : .12;
67254
- ctx.lineWidth = isActive ? 2.5 : 1.5;
67255
- ctx.setLineDash(isActive ? [] : [6, 4]);
67252
+ ctx.globalAlpha = .22;
67253
+ ctx.lineWidth = 2.5;
67254
+ ctx.setLineDash([]);
67256
67255
  ctx.beginPath();
67257
67256
  const first = worldToScreen(pts[0].x, pts[0].y);
67258
67257
  ctx.moveTo(first.x, first.y);
@@ -67264,10 +67263,9 @@ function FloorPlanCanvas($$anchor, $$props) {
67264
67263
  ctx.fill();
67265
67264
  ctx.globalAlpha = 1;
67266
67265
  ctx.stroke();
67267
- ctx.setLineDash([]);
67268
67266
  for (let i = 0; i < pts.length; i++) {
67269
67267
  const s = worldToScreen(pts[i].x, pts[i].y);
67270
- drawVertexIndexBadge(ctx, s.x, s.y, i, color, isActive ? 9 : 7);
67268
+ drawVertexIndexBadge(ctx, s.x, s.y, i, color, 9);
67271
67269
  }
67272
67270
  ctx.restore();
67273
67271
  }
@@ -69091,9 +69089,26 @@ function FloorPlanCanvas($$anchor, $$props) {
69091
69089
  return;
69092
69090
  }
69093
69091
  if (tool === "select") {
69094
- const objectAboveZone = get(showFurniture) && (!!findFurnitureAt$1(wp) || !!findHandleAt$1(wp)) || get(layerVis).columns && !!findColumnAt$1(wp) || get(showStairs) && !!findStairAt$1(wp);
69095
- if (!objectAboveZone) {
69092
+ const objectAbove = get(showFurniture) && (!!findFurnitureAt$1(wp) || !!findHandleAt$1(wp)) || get(layerVis).columns && !!findColumnAt$1(wp) || get(showStairs) && !!findStairAt$1(wp);
69093
+ if (!objectAbove) {
69096
69094
  var _$$get9;
69095
+ const fovHit = findFovCameraAt(wp);
69096
+ if (fovHit === null || fovHit === void 0 ? void 0 : fovHit.serial) {
69097
+ var _fovHit$props;
69098
+ const bounds = getInteriorFloorBounds(get(currentFloor));
69099
+ const pts = bounds ? mapCoordinatesToWorldPoints((_fovHit$props = fovHit.props) === null || _fovHit$props === void 0 ? void 0 : _fovHit$props.mapCoordinates, bounds) : [];
69100
+ const vIdx = pts.length ? findFovVertexAt(wp, pts) : -1;
69101
+ set(selectedFovSerial, fovHit.serial, true);
69102
+ set(fovSelectionOnly, true);
69103
+ set(draggingFovVertex, vIdx >= 0 ? vIdx : null, true);
69104
+ set(selectedZoneId, null);
69105
+ selectedElementId.set(fovHit.id);
69106
+ set(selectedTextAnnotationId, null);
69107
+ set(selectedAnnotationId, null);
69108
+ set(selectedMeasurementId, null);
69109
+ if (vIdx >= 0) beginUndoGroup();
69110
+ return;
69111
+ }
69097
69112
  if (((_$$get9 = get(currentFloor)) === null || _$$get9 === void 0 || (_$$get9 = _$$get9.zones) === null || _$$get9 === void 0 ? void 0 : _$$get9.length) && get(layerVis).zones) {
69098
69113
  const zHit = findZoneAt(wp, get(currentFloor).zones, get(zoom));
69099
69114
  if (zHit) {
@@ -69120,26 +69135,9 @@ function FloorPlanCanvas($$anchor, $$props) {
69120
69135
  return;
69121
69136
  }
69122
69137
  }
69123
- const fovHit = findFovCameraAt(wp);
69124
- if (fovHit === null || fovHit === void 0 ? void 0 : fovHit.serial) {
69125
- var _fovHit$props;
69126
- const bounds = getInteriorFloorBounds(get(currentFloor));
69127
- const pts = bounds ? mapCoordinatesToWorldPoints((_fovHit$props = fovHit.props) === null || _fovHit$props === void 0 ? void 0 : _fovHit$props.mapCoordinates, bounds) : [];
69128
- const vIdx = pts.length ? findFovVertexAt(wp, pts) : -1;
69129
- set(selectedFovSerial, fovHit.serial, true);
69130
- set(fovSelectionOnly, true);
69131
- set(draggingFovVertex, vIdx >= 0 ? vIdx : null, true);
69132
- set(selectedZoneId, null);
69133
- selectedElementId.set(fovHit.id);
69134
- set(selectedTextAnnotationId, null);
69135
- set(selectedAnnotationId, null);
69136
- set(selectedMeasurementId, null);
69137
- if (vIdx >= 0) beginUndoGroup();
69138
- return;
69139
- }
69140
69138
  }
69141
69139
  set(selectedZoneId, null);
69142
- if (!objectAboveZone) {
69140
+ if (!objectAbove) {
69143
69141
  set(selectedFovSerial, null);
69144
69142
  set(fovSelectionOnly, false);
69145
69143
  }