Skip to content

Commit b9a1128

Browse files
committed
checkpoint boundary selection work
1 parent e92bc62 commit b9a1128

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/void/sketch/geometry.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,10 @@ function resolveDerivedEdgeCandidate(event, intersections, feature) {
333333
const bestSegDist = this.distanceToSegmentPx(vp.x, vp.y, pwa?.x || 0, pwa?.y || 0, pwb?.x || 0, pwb?.y || 0);
334334
// Only treat as edge-hover when pointer is genuinely near the edge.
335335
// Otherwise keep face-hover path active so full boundary preview renders.
336-
if (!Number.isFinite(bestSegDist) || bestSegDist > (SKETCH_HIT_LINE_PX * 1.25)) {
336+
// Edge mode should only activate when genuinely near a boundary.
337+
// Otherwise allow face mode to show the full boundary set.
338+
const edgeHoverPx = Math.max(2.5, SKETCH_HIT_LINE_PX * 0.65);
339+
if (!Number.isFinite(bestSegDist) || bestSegDist > edgeHoverPx) {
337340
return null;
338341
}
339342
const pointHits = [];

src/void/sketch/pointer.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,15 @@ function handleSketchHover(event, intersections) {
254254

255255
const hit = this.resolveSketchHit(event, intersections, feature);
256256
const hasIntersections = Array.isArray(intersections) && intersections.length > 0;
257-
let derived = hasIntersections
258-
? this.resolveDerivedEdgeCandidate(event, intersections, feature)
259-
: (this.hoveredDerivedCandidate || null);
257+
const primary = hasIntersections
258+
? (this.getPrimarySurfaceHitFromIntersections?.(intersections) || null)
259+
: null;
260+
let derived = null;
261+
if (hasIntersections && primary?.type === 'solid-edge') {
262+
derived = this.resolveDerivedEdgeCandidate(event, intersections, feature);
263+
} else if (!hasIntersections) {
264+
derived = this.hoveredDerivedCandidate || null;
265+
}
260266
if (hit?.id) {
261267
// Current sketch entities take priority over any behind-surface derive targets.
262268
derived = null;

0 commit comments

Comments
 (0)