mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-05 06:08:59 +00:00
fix(2.5d): room metrics keep their distance from the name at every zoom (#665)
The raised room label in 2.5D View sized its own box to the 44 px touch minimum (min-height + justify-content: center). The name therefore sat centred in 44 px while the metrics row, placed absolutely from the label bottom, hung (44 - name height) / 2 below it: 18.3 px at a 9 px name and 6.4 px at a 39 px one on the demo stand, against a constant 0.1 name height on the flat plan. The 44 x 44 px floor moves into an invisible ::before (the door-lock pattern), z-index -1 inside the label stacking context; the label box is sized by its text again. demo/smoke_iso_room_label_metrics.mjs measures gap / name height at two cameras (font x4) in Flat and 2.5D, and the 44 px floor and area-link hit targets on labels no raised device covers. Mutant iso-room-label-44-box-centres-name. Screenshots: 11 frames pixel-identical, fingerprint only. Issue: #665 User-Visible: yes
This commit is contained in:
@@ -691,15 +691,29 @@ export const planStyles = css`
|
||||
}
|
||||
.stage.projection-iso.mode-view .roomlabel {
|
||||
box-sizing: border-box;
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
justify-content: center;
|
||||
text-shadow: none;
|
||||
filter: none;
|
||||
-webkit-text-stroke: 0 transparent;
|
||||
/* #649 3b: the configured room label colour (inline, as in Flat) is
|
||||
kept in both themes; 2.5D only drops stroke, shadow and halo. */
|
||||
}
|
||||
/* #665: the 44 x 44 px touch floor of a raised room label is an invisible
|
||||
pseudo-element, as on door locks: sizing the label box itself centred the
|
||||
name in 44 px and pushed the absolutely placed metrics row away from it
|
||||
by (44 - name height) / 2, so the metrics drifted as the zoom changed the
|
||||
font. z-index -1 paints the floor below the label content, inside the
|
||||
label's own stacking context (z-index 1). */
|
||||
.stage.projection-iso.mode-view .roomlabel::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: max(44px, 100%);
|
||||
height: max(44px, 100%);
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: -1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
/* Interactive raised overlays stay above passive room names. Collision
|
||||
placement never needs to move or promote a label to make a device usable. */
|
||||
.stage.projection-iso.mode-view .dev,
|
||||
|
||||
Reference in New Issue
Block a user