mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 08:28:31 +00:00
feat v1.23.1: openings — hover outline, drag along walls, double-click properties
- Hover: an accent outline hugs the opening's wall strip + grab cursor. - Drag (view mode): re-snaps continuously to the nearest derived wall; snapToWall now normalizes the angle to [-90,90) — neighbouring rooms yield the same wall in opposite directions, which used to flip the hinge while dragging across segment boundaries. setPointerCapture wrapped in try/catch (an inactive pointerId must not kill the drag). - Click still opens the status card (via a 250ms timer); double click opens the properties dialog from view mode. Hit zone is now a slightly thicker strip along the wall instead of the whole swing square (fewer accidental hovers). +1 test (77). Verified live: drag moved a test door exactly along a vertical wall (angle 90 -> -90), click/dblclick/markup-tool paths all работают; the user's 12 real openings untouched.
This commit is contained in:
+17
-1
@@ -233,10 +233,26 @@ export const cardStyles = css`
|
||||
stroke-width: 1.5;
|
||||
transition: stroke-dashoffset 0.6s ease;
|
||||
}
|
||||
/* hover affordance: a rounded outline hugging the wall strip + a grab cursor */
|
||||
.op-outline {
|
||||
fill: none;
|
||||
stroke: var(--hp-accent);
|
||||
stroke-width: 1.5;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s;
|
||||
pointer-events: none;
|
||||
}
|
||||
g.opening:hover .op-outline {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.op-hit {
|
||||
fill: transparent;
|
||||
cursor: pointer;
|
||||
cursor: grab;
|
||||
pointer-events: auto;
|
||||
touch-action: none; /* drags, not scrolls, on touch */
|
||||
}
|
||||
.op-hit:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
.stage.markup .op-hit {
|
||||
pointer-events: none; /* markup clicks go to the stage tools */
|
||||
|
||||
Reference in New Issue
Block a user