[fix] render toolbar off-state slashes correctly in software mode

This commit is contained in:
dijunkun
2026-09-25 03:26:49 +08:00
parent f73a57baaa
commit 41cab6fa0b
+14 -16
View File
@@ -115,23 +115,21 @@ component ControlBarButton inherits Rectangle {
font-size: 11px; font-size: 11px;
} }
// Match the two offset diagonal strokes used by the ImGui mouse/audio // Draw the two offset disabled-state strokes as paths. Rotated rectangles
// disabled state instead of covering the glyph with a full-width slash. // stay vertical in the software renderer used for fallback and UI capture.
if root.slashed: Rectangle { if root.slashed: Path {
x: 11px; width: 24px; height: 24px;
y: 0px; viewbox-width: 24; viewbox-height: 24;
width: 2px; commands: "M 3.5 3.5 L 20.5 20.5";
height: 24px; stroke: black;
background: black; stroke-width: 2px;
transform-rotation: -45deg;
} }
if root.slashed: Rectangle { if root.slashed: Path {
x: 9.5px; width: 24px; height: 24px;
y: 1.5px; viewbox-width: 24; viewbox-height: 24;
width: 2px; commands: "M 2 5 L 19 22";
height: 24px; stroke: touch.has-hover ? #4296fa : #b3d5fd;
background: touch.has-hover ? #4296fa : #b3d5fd; stroke-width: 2px;
transform-rotation: -45deg;
} }
touch := TouchArea { touch := TouchArea {