backgrounds: fix degenerate inner hole subpath in BarBackground when not framed

This commit is contained in:
Lemmy
2026-03-04 13:52:20 -05:00
parent cf326a71fc
commit c9b6fc9ef9
@@ -216,68 +216,70 @@ ShapePath {
}
// 2. Inner Hole for Framed Mode (Clockwise)
// When !isFramed, duplicates the outer bar path as a WindingFill no-op (winding becomes 2,
// still non-zero, same fill result) to prevent a zero-area degenerate subpath crashing qTriangulate.
PathMove {
x: (root.isFramed && root.shouldShow) ? (root.holeX + root.frameRadius) : root.startX
y: (root.isFramed && root.shouldShow) ? root.holeY : root.startY
x: root.isFramed ? (root.shouldShow ? root.holeX + root.frameRadius : 0) : root.startX
y: root.isFramed ? (root.shouldShow ? root.holeY : 0) : root.startY
}
// Top edge
PathLine {
x: (root.isFramed && root.shouldShow) ? (root.holeX + root.holeWidth - root.frameRadius) : ((root.isFramed && root.shouldShow) ? (root.holeX + root.frameRadius) : root.startX)
y: (root.isFramed && root.shouldShow) ? root.holeY : ((root.isFramed && root.shouldShow) ? root.holeY : root.startY)
x: root.isFramed ? (root.shouldShow ? root.holeX + root.holeWidth - root.frameRadius : 0) : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs - root.trRadius * root.trMultX)
y: root.isFramed ? (root.shouldShow ? root.holeY : 0) : (root.barMappedPos.y + root.topEdgeOvs)
}
// Top-right corner
PathArc {
x: (root.isFramed && root.shouldShow) ? (root.holeX + root.holeWidth) : ((root.isFramed && root.shouldShow) ? (root.holeX + root.holeWidth - root.frameRadius) : root.startX)
y: (root.isFramed && root.shouldShow) ? (root.holeY + root.frameRadius) : ((root.isFramed && root.shouldShow) ? root.holeY : root.startY)
radiusX: (root.isFramed && root.shouldShow) ? root.frameRadius : 0
radiusY: (root.isFramed && root.shouldShow) ? root.frameRadius : 0
direction: PathArc.Clockwise
x: root.isFramed ? (root.shouldShow ? root.holeX + root.holeWidth : 0) : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs)
y: root.isFramed ? (root.shouldShow ? root.holeY + root.frameRadius : 0) : (root.barMappedPos.y + root.topEdgeOvs + root.trRadius * root.trMultY)
radiusX: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : root.trRadius
radiusY: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : root.trRadius
direction: root.isFramed ? PathArc.Clockwise : ShapeCornerHelper.getArcDirection(root.trMultX, root.trMultY)
}
// Right edge
PathLine {
x: (root.isFramed && root.shouldShow) ? (root.holeX + root.holeWidth) : root.startX
y: (root.isFramed && root.shouldShow) ? (root.holeY + root.holeHeight - root.frameRadius) : root.startY
x: root.isFramed ? (root.shouldShow ? root.holeX + root.holeWidth : 0) : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs)
y: root.isFramed ? (root.shouldShow ? root.holeY + root.holeHeight - root.frameRadius : 0) : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs - root.brRadius * root.brMultY)
}
// Bottom-right corner
PathArc {
x: (root.isFramed && root.shouldShow) ? (root.holeX + root.holeWidth - root.frameRadius) : root.startX
y: (root.isFramed && root.shouldShow) ? (root.holeY + root.holeHeight) : root.startY
radiusX: (root.isFramed && root.shouldShow) ? root.frameRadius : 0
radiusY: (root.isFramed && root.shouldShow) ? root.frameRadius : 0
direction: PathArc.Clockwise
x: root.isFramed ? (root.shouldShow ? root.holeX + root.holeWidth - root.frameRadius : 0) : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs - root.brRadius * root.brMultX)
y: root.isFramed ? (root.shouldShow ? root.holeY + root.holeHeight : 0) : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs)
radiusX: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : root.brRadius
radiusY: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : root.brRadius
direction: root.isFramed ? PathArc.Clockwise : ShapeCornerHelper.getArcDirection(root.brMultX, root.brMultY)
}
// Bottom edge
PathLine {
x: (root.isFramed && root.shouldShow) ? (root.holeX + root.frameRadius) : root.startX
y: (root.isFramed && root.shouldShow) ? (root.holeY + root.holeHeight) : root.startY
x: root.isFramed ? (root.shouldShow ? root.holeX + root.frameRadius : 0) : (root.barMappedPos.x + root.leftEdgeOvs + root.blRadius * root.blMultX)
y: root.isFramed ? (root.shouldShow ? root.holeY + root.holeHeight : 0) : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs)
}
// Bottom-left corner
PathArc {
x: (root.isFramed && root.shouldShow) ? root.holeX : root.startX
y: (root.isFramed && root.shouldShow) ? (root.holeY + root.holeHeight - root.frameRadius) : root.startY
radiusX: (root.isFramed && root.shouldShow) ? root.frameRadius : 0
radiusY: (root.isFramed && root.shouldShow) ? root.frameRadius : 0
direction: PathArc.Clockwise
x: root.isFramed ? (root.shouldShow ? root.holeX : 0) : (root.barMappedPos.x + root.leftEdgeOvs)
y: root.isFramed ? (root.shouldShow ? root.holeY + root.holeHeight - root.frameRadius : 0) : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs - root.blRadius * root.blMultY)
radiusX: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : root.blRadius
radiusY: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : root.blRadius
direction: root.isFramed ? PathArc.Clockwise : ShapeCornerHelper.getArcDirection(root.blMultX, root.blMultY)
}
// Left edge
PathLine {
x: (root.isFramed && root.shouldShow) ? root.holeX : root.startX
y: (root.isFramed && root.shouldShow) ? (root.holeY + root.frameRadius) : root.startY
x: root.isFramed ? (root.shouldShow ? root.holeX : 0) : (root.barMappedPos.x + root.leftEdgeOvs)
y: root.isFramed ? (root.shouldShow ? root.holeY + root.frameRadius : 0) : (root.barMappedPos.y + root.topEdgeOvs + root.tlRadius * root.tlMultY)
}
// Top-left corner (back to start)
PathArc {
x: (root.isFramed && root.shouldShow) ? (root.holeX + root.frameRadius) : root.startX
y: (root.isFramed && root.shouldShow) ? root.holeY : root.startY
radiusX: (root.isFramed && root.shouldShow) ? root.frameRadius : 0
radiusY: (root.isFramed && root.shouldShow) ? root.frameRadius : 0
direction: PathArc.Clockwise
x: root.isFramed ? (root.shouldShow ? root.holeX + root.frameRadius : 0) : (root.barMappedPos.x + root.leftEdgeOvs + root.tlRadius * root.tlMultX)
y: root.isFramed ? (root.shouldShow ? root.holeY : 0) : (root.barMappedPos.y + root.topEdgeOvs)
radiusX: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : root.tlRadius
radiusY: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : root.tlRadius
direction: root.isFramed ? PathArc.Clockwise : ShapeCornerHelper.getArcDirection(root.tlMultX, root.tlMultY)
}
}