fix(node): only round a box that has a border

A filled box without one is a plain rectangle: rounding it leaves the
surface showing at the corners, which reads as a seam nobody asked for.
This commit is contained in:
2026-08-03 18:28:26 -04:00
parent 2255fe214e
commit a5af6b5af4
2 changed files with 10 additions and 4 deletions
+6 -3
View File
@@ -78,13 +78,16 @@ class Painter {
const bool hasFill = own && (own->set & S_FILL);
if (!hasFill && !hasBorder) return;
const int32_t radius = tree.inherited(id, S_RADIUS).radius;
if (hasFill && radius == 0 && !hasBorder) {
// Only a bordered box rounds its corners. Filling a square first would leave corners
// outside the border, and rounding an unbordered fill puts a seam where a plain panel
// background was expected.
if (!hasBorder) {
gui.fillRect(n.x, n.y, n.w, n.h, own->fill);
return;
}
const int32_t fill = hasFill ? own->fill : tree.inherited(id, S_BG).bg;
gui.roundRect(n.x, n.y, n.w, n.h, radius, surfaceOf(id), &fill, &fill, hasBorder ? &own->border : nullptr);
gui.roundRect(n.x, n.y, n.w, n.h, tree.inherited(id, S_RADIUS).radius, surfaceOf(id), &fill, &fill,
&own->border);
}
void paintButton(uint16_t id) {