Merge branch 'noctalia-dev:main' into auto-connect-improvements

This commit is contained in:
Turann_
2026-03-05 23:03:06 +03:00
committed by GitHub
10 changed files with 133 additions and 116 deletions
+7 -7
View File
@@ -148,13 +148,13 @@
;; Org mode with hidden asterisks
`(org-level-1 ((t (:foreground ,primary :weight bold :height 1.2))))
`(org-level-2 ((t (:foreground ,primary-container :weight bold :height 1.1))))
`(org-level-3 ((t (:foreground ,secondary :weight bold))))
`(org-level-4 ((t (:foreground ,secondary-container :weight bold))))
`(org-level-5 ((t (:foreground ,tertiary :weight bold))))
`(org-level-6 ((t (:foreground ,tertiary-container :weight bold))))
`(org-level-7 ((t (:foreground ,primary-fixed :weight bold))))
`(org-level-8 ((t (:foreground ,primary-fixed-dim :weight bold))))
`(org-level-2 ((t (:foreground ,secondary :weight bold :height 1.1))))
`(org-level-3 ((t (:foreground ,tertiary :weight bold))))
`(org-level-4 ((t (:foreground ,primary :weight bold))))
`(org-level-5 ((t (:foreground ,secondary :weight bold))))
`(org-level-6 ((t (:foreground ,tertiary :weight bold))))
`(org-level-7 ((t (:foreground ,primary :weight bold))))
`(org-level-8 ((t (:foreground ,secondary :weight bold))))
`(org-document-title ((t (:foreground ,primary :weight bold :height 1.3))))
`(org-document-info ((t (:foreground ,primary-container))))
`(org-todo ((t (:foreground ,err :weight bold))))
@@ -44,10 +44,6 @@
--zen-primary-color: {{colors.primary.default.hex}} !important;
}
groupbox , moz-card{
background: {{colors.surface_container.default.hex}} !important;
}
button,
groupbox menulist {
background: {{colors.surface_container_high.default.hex}} !important;
@@ -103,6 +103,10 @@ ShapePath {
readonly property real blMultY: bar ? ShapeCornerHelper.getMultY(bar.bottomLeftCornerState) : 1
readonly property real blRadius: bar ? getCornerRadius(bar.bottomLeftCornerState) : 0
// True when the bar path has valid, non-degenerate geometry to render.
// Mirrors PanelBackground.isRenderable — prevents CurveRenderer crash on zero-area paths.
readonly property bool isRenderable: bar !== null && shouldShow && (isFramed ? (screenWidth > 0 && screenHeight > 0) : (barWidth > 0 && barHeight > 0))
// Extend bar background beyond screen edges where both adjacent corners are flat,
// to prevent CurveRenderer antialiasing artifacts on screen-flush edges
readonly property real screenEdgeOvershoot: 2
@@ -124,94 +128,74 @@ ShapePath {
// ShapePath configuration
strokeWidth: -1 // No stroke, fill only
fillColor: shouldShow ? Qt.rgba(backgroundColor.r, backgroundColor.g, backgroundColor.b, backgroundColor.a * opacityFactor) : "transparent"
fillColor: isRenderable ? Qt.rgba(backgroundColor.r, backgroundColor.g, backgroundColor.b, backgroundColor.a * opacityFactor) : "transparent"
fillRule: isFramed ? ShapePath.OddEvenFill : ShapePath.WindingFill
// Starting position
// In framed mode, we start at (0,0) to draw the screen rectangle first
startX: isFramed ? 0 : (barMappedPos.x + leftEdgeOvs + tlRadius * tlMultX)
startY: isFramed ? 0 : (barMappedPos.y + topEdgeOvs)
// Starting position — falls back to off-screen (-1,-1) when not renderable so that
// all subsequent path elements form a valid non-degenerate 1×1 off-screen square,
// preventing CurveRenderer triangulation crashes on zero-area or bare-moveto paths.
startX: isRenderable ? (isFramed ? 0 : (barMappedPos.x + leftEdgeOvs + tlRadius * tlMultX)) : -1
startY: isRenderable ? (isFramed ? 0 : (barMappedPos.y + topEdgeOvs)) : -1
// ========== PATH DEFINITION ==========
// 1. Main Bar / Outer Screen Rectangle
// When !isRenderable all elements use fallback coordinates forming a valid 1×1
// off-screen square ((-1,-1)→(0,-1)→(0,0)→(-1,0)→(-1,-1)) so CurveRenderer
// never receives a zero-area or bare-moveto path.
PathLine {
x: {
if (!root.shouldShow)
return 0;
if (root.isFramed)
return root.screenWidth;
return root.barMappedPos.x + root.barWidth + root.rightEdgeOvs - root.trRadius * root.trMultX;
}
y: root.isFramed ? 0 : (root.barMappedPos.y + root.topEdgeOvs)
x: root.isRenderable ? (root.isFramed ? root.screenWidth : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs - root.trRadius * root.trMultX)) : 0
y: root.isRenderable ? (root.isFramed ? 0 : (root.barMappedPos.y + root.topEdgeOvs)) : -1
}
// Bar top-right corner (only if not framed)
PathArc {
x: root.isFramed ? (root.shouldShow ? root.screenWidth : 0) : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs)
y: root.isFramed ? 0 : (root.barMappedPos.y + root.topEdgeOvs + root.trRadius * root.trMultY)
radiusX: root.isFramed ? 0 : root.trRadius
radiusY: root.isFramed ? 0 : root.trRadius
x: root.isRenderable ? (root.isFramed ? root.screenWidth : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs)) : 0
y: root.isRenderable ? (root.isFramed ? 0 : (root.barMappedPos.y + root.topEdgeOvs + root.trRadius * root.trMultY)) : -1
radiusX: root.isRenderable ? (root.isFramed ? 0 : root.trRadius) : 0
radiusY: root.isRenderable ? (root.isFramed ? 0 : root.trRadius) : 0
direction: ShapeCornerHelper.getArcDirection(root.trMultX, root.trMultY)
}
PathLine {
x: root.isFramed ? (root.shouldShow ? root.screenWidth : 0) : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs)
y: {
if (!root.shouldShow)
return 0;
if (root.isFramed)
return root.screenHeight;
return root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs - root.brRadius * root.brMultY;
}
x: root.isRenderable ? (root.isFramed ? root.screenWidth : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs)) : 0
y: root.isRenderable ? (root.isFramed ? root.screenHeight : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs - root.brRadius * root.brMultY)) : 0
}
// Bar bottom-right corner (only if not framed)
PathArc {
x: root.isFramed ? (root.shouldShow ? root.screenWidth : 0) : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs - root.brRadius * root.brMultX)
y: root.isFramed ? (root.shouldShow ? root.screenHeight : 0) : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs)
radiusX: root.isFramed ? 0 : root.brRadius
radiusY: root.isFramed ? 0 : root.brRadius
x: root.isRenderable ? (root.isFramed ? root.screenWidth : (root.barMappedPos.x + root.barWidth + root.rightEdgeOvs - root.brRadius * root.brMultX)) : 0
y: root.isRenderable ? (root.isFramed ? root.screenHeight : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs)) : 0
radiusX: root.isRenderable ? (root.isFramed ? 0 : root.brRadius) : 0
radiusY: root.isRenderable ? (root.isFramed ? 0 : root.brRadius) : 0
direction: ShapeCornerHelper.getArcDirection(root.brMultX, root.brMultY)
}
PathLine {
x: {
if (!root.shouldShow)
return 0;
if (root.isFramed)
return 0;
return root.barMappedPos.x + root.leftEdgeOvs + root.blRadius * root.blMultX;
}
y: root.isFramed ? (root.shouldShow ? root.screenHeight : 0) : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs)
x: root.isRenderable ? (root.isFramed ? 0 : (root.barMappedPos.x + root.leftEdgeOvs + root.blRadius * root.blMultX)) : -1
y: root.isRenderable ? (root.isFramed ? root.screenHeight : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs)) : 0
}
// Bar bottom-left corner (only if not framed)
PathArc {
x: root.isFramed ? 0 : (root.barMappedPos.x + root.leftEdgeOvs)
y: root.isFramed ? (root.shouldShow ? root.screenHeight : 0) : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs - root.blRadius * root.blMultY)
radiusX: root.isFramed ? 0 : root.blRadius
radiusY: root.isFramed ? 0 : root.blRadius
x: root.isRenderable ? (root.isFramed ? 0 : (root.barMappedPos.x + root.leftEdgeOvs)) : -1
y: root.isRenderable ? (root.isFramed ? root.screenHeight : (root.barMappedPos.y + root.barHeight + root.bottomEdgeOvs - root.blRadius * root.blMultY)) : 0
radiusX: root.isRenderable ? (root.isFramed ? 0 : root.blRadius) : 0
radiusY: root.isRenderable ? (root.isFramed ? 0 : root.blRadius) : 0
direction: ShapeCornerHelper.getArcDirection(root.blMultX, root.blMultY)
}
PathLine {
x: root.isFramed ? 0 : (root.barMappedPos.x + root.leftEdgeOvs)
y: {
if (!root.shouldShow)
return 0;
if (root.isFramed)
return 0;
return root.barMappedPos.y + root.topEdgeOvs + root.tlRadius * root.tlMultY;
}
x: root.isRenderable ? (root.isFramed ? 0 : (root.barMappedPos.x + root.leftEdgeOvs)) : -1
y: root.isRenderable ? (root.isFramed ? 0 : (root.barMappedPos.y + root.topEdgeOvs + root.tlRadius * root.tlMultY)) : -1
}
// Bar top-left corner (only if not framed, back to start)
PathArc {
x: root.isFramed ? 0 : (root.barMappedPos.x + root.leftEdgeOvs + root.tlRadius * root.tlMultX)
y: root.isFramed ? 0 : (root.barMappedPos.y + root.topEdgeOvs)
radiusX: root.isFramed ? 0 : root.tlRadius
radiusY: root.isFramed ? 0 : root.tlRadius
x: root.isRenderable ? (root.isFramed ? 0 : (root.barMappedPos.x + root.leftEdgeOvs + root.tlRadius * root.tlMultX)) : -1
y: root.isRenderable ? (root.isFramed ? 0 : (root.barMappedPos.y + root.topEdgeOvs)) : -1
radiusX: root.isRenderable ? (root.isFramed ? 0 : root.tlRadius) : 0
radiusY: root.isRenderable ? (root.isFramed ? 0 : root.tlRadius) : 0
direction: ShapeCornerHelper.getArcDirection(root.tlMultX, root.tlMultY)
}
@@ -220,70 +204,71 @@ ShapePath {
// no-op to prevent a zero-area degenerate subpath crashing qTriangulate.
// Note: an exact duplicate of the outer path cannot be used here because Qt's CurveRenderer
// has issues with exactly coincident subpaths, causing the fill to not render on some systems.
// When !isRenderable, falls back to a valid 1×1 off-screen square at (-3,-3)→(-2,-2).
readonly property real _nhX: barMappedPos.x + barWidth / 2
readonly property real _nhY: barMappedPos.y + barHeight / 2
PathMove {
x: root.isFramed ? (root.shouldShow ? root.holeX + root.frameRadius : 0) : root._nhX
y: root.isFramed ? (root.shouldShow ? root.holeY : 0) : root._nhY
x: root.isRenderable ? (root.isFramed ? (root.holeX + root.frameRadius) : root._nhX) : -3
y: root.isRenderable ? (root.isFramed ? root.holeY : root._nhY) : -3
}
// Top edge
PathLine {
x: root.isFramed ? (root.shouldShow ? root.holeX + root.holeWidth - root.frameRadius : 0) : (root._nhX + 1)
y: root.isFramed ? (root.shouldShow ? root.holeY : 0) : root._nhY
x: root.isRenderable ? (root.isFramed ? (root.holeX + root.holeWidth - root.frameRadius) : (root._nhX + 1)) : -2
y: root.isRenderable ? (root.isFramed ? root.holeY : root._nhY) : -3
}
// Top-right corner
PathArc {
x: root.isFramed ? (root.shouldShow ? root.holeX + root.holeWidth : 0) : (root._nhX + 1)
y: root.isFramed ? (root.shouldShow ? root.holeY + root.frameRadius : 0) : root._nhY
radiusX: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : 0
radiusY: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : 0
x: root.isRenderable ? (root.isFramed ? (root.holeX + root.holeWidth) : (root._nhX + 1)) : -2
y: root.isRenderable ? (root.isFramed ? (root.holeY + root.frameRadius) : root._nhY) : -3
radiusX: root.isRenderable ? (root.isFramed ? root.frameRadius : 0) : 0
radiusY: root.isRenderable ? (root.isFramed ? root.frameRadius : 0) : 0
direction: PathArc.Clockwise
}
// Right edge
PathLine {
x: root.isFramed ? (root.shouldShow ? root.holeX + root.holeWidth : 0) : (root._nhX + 1)
y: root.isFramed ? (root.shouldShow ? root.holeY + root.holeHeight - root.frameRadius : 0) : (root._nhY + 1)
x: root.isRenderable ? (root.isFramed ? (root.holeX + root.holeWidth) : (root._nhX + 1)) : -2
y: root.isRenderable ? (root.isFramed ? (root.holeY + root.holeHeight - root.frameRadius) : (root._nhY + 1)) : -2
}
// Bottom-right corner
PathArc {
x: root.isFramed ? (root.shouldShow ? root.holeX + root.holeWidth - root.frameRadius : 0) : (root._nhX + 1)
y: root.isFramed ? (root.shouldShow ? root.holeY + root.holeHeight : 0) : (root._nhY + 1)
radiusX: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : 0
radiusY: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : 0
x: root.isRenderable ? (root.isFramed ? (root.holeX + root.holeWidth - root.frameRadius) : (root._nhX + 1)) : -2
y: root.isRenderable ? (root.isFramed ? (root.holeY + root.holeHeight) : (root._nhY + 1)) : -2
radiusX: root.isRenderable ? (root.isFramed ? root.frameRadius : 0) : 0
radiusY: root.isRenderable ? (root.isFramed ? root.frameRadius : 0) : 0
direction: PathArc.Clockwise
}
// Bottom edge
PathLine {
x: root.isFramed ? (root.shouldShow ? root.holeX + root.frameRadius : 0) : root._nhX
y: root.isFramed ? (root.shouldShow ? root.holeY + root.holeHeight : 0) : (root._nhY + 1)
x: root.isRenderable ? (root.isFramed ? (root.holeX + root.frameRadius) : root._nhX) : -3
y: root.isRenderable ? (root.isFramed ? (root.holeY + root.holeHeight) : (root._nhY + 1)) : -2
}
// Bottom-left corner
PathArc {
x: root.isFramed ? (root.shouldShow ? root.holeX : 0) : root._nhX
y: root.isFramed ? (root.shouldShow ? root.holeY + root.holeHeight - root.frameRadius : 0) : (root._nhY + 1)
radiusX: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : 0
radiusY: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : 0
x: root.isRenderable ? (root.isFramed ? root.holeX : root._nhX) : -3
y: root.isRenderable ? (root.isFramed ? (root.holeY + root.holeHeight - root.frameRadius) : (root._nhY + 1)) : -2
radiusX: root.isRenderable ? (root.isFramed ? root.frameRadius : 0) : 0
radiusY: root.isRenderable ? (root.isFramed ? root.frameRadius : 0) : 0
direction: PathArc.Clockwise
}
// Left edge
PathLine {
x: root.isFramed ? (root.shouldShow ? root.holeX : 0) : root._nhX
y: root.isFramed ? (root.shouldShow ? root.holeY + root.frameRadius : 0) : root._nhY
x: root.isRenderable ? (root.isFramed ? root.holeX : root._nhX) : -3
y: root.isRenderable ? (root.isFramed ? (root.holeY + root.frameRadius) : root._nhY) : -3
}
// Top-left corner (back to start)
PathArc {
x: root.isFramed ? (root.shouldShow ? root.holeX + root.frameRadius : 0) : root._nhX
y: root.isFramed ? (root.shouldShow ? root.holeY : 0) : root._nhY
radiusX: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : 0
radiusY: root.isFramed ? (root.shouldShow ? root.frameRadius : 0) : 0
x: root.isRenderable ? (root.isFramed ? (root.holeX + root.frameRadius) : root._nhX) : -3
y: root.isRenderable ? (root.isFramed ? root.holeY : root._nhY) : -3
radiusX: root.isRenderable ? (root.isFramed ? root.frameRadius : 0) : 0
radiusY: root.isRenderable ? (root.isFramed ? root.frameRadius : 0) : 0
direction: PathArc.Clockwise
}
}
@@ -53,6 +53,7 @@ ShapePath {
readonly property real panelY: panelBg ? panelBg.y : 0
readonly property real panelWidth: panelBg ? panelBg.width : 0
readonly property real panelHeight: panelBg ? panelBg.height : 0
readonly property bool isRenderable: assignedPanel && panelBg && panelWidth > 0 && panelHeight > 0
// Flatten corners if panel is too small
readonly property bool shouldFlatten: panelBg ? ShapeCornerHelper.shouldFlatten(panelWidth, panelHeight, radius) : false
@@ -87,11 +88,11 @@ ShapePath {
// ShapePath configuration
strokeWidth: -1 // No stroke, fill only
// Starting position (top-left corner, after the arc)
startX: panelX + tlRadius * tlMultX
startY: panelY
// Start point - use tiny off-screen non-degenerate fallback when not renderable.
startX: isRenderable ? (panelX + tlRadius * tlMultX) : -1
startY: isRenderable ? panelY : -1
fillColor: (assignedPanel && panelBg && panelWidth > 0 && panelHeight > 0) ? effectiveBackgroundColor : "transparent"
fillColor: isRenderable ? effectiveBackgroundColor : "transparent"
// ========== PATH DEFINITION ==========
// Draws a rectangle with potentially inverted corners
@@ -99,61 +100,61 @@ ShapePath {
// Top edge (moving right)
PathLine {
relativeX: root.panelWidth - root.tlRadius * root.tlMultX - root.trRadius * root.trMultX
relativeX: root.isRenderable ? (root.panelWidth - root.tlRadius * root.tlMultX - root.trRadius * root.trMultX) : 1
relativeY: 0
}
// Top-right corner arc
PathArc {
relativeX: root.trRadius * root.trMultX
relativeY: root.trRadius * root.trMultY
radiusX: root.trRadius
radiusY: root.trRadius
relativeX: root.isRenderable ? (root.trRadius * root.trMultX) : 0
relativeY: root.isRenderable ? (root.trRadius * root.trMultY) : 0
radiusX: root.isRenderable ? root.trRadius : 0
radiusY: root.isRenderable ? root.trRadius : 0
direction: ShapeCornerHelper.getArcDirection(root.trMultX, root.trMultY)
}
// Right edge (moving down)
PathLine {
relativeX: 0
relativeY: root.panelHeight - root.trRadius * root.trMultY - root.brRadius * root.brMultY
relativeY: root.isRenderable ? (root.panelHeight - root.trRadius * root.trMultY - root.brRadius * root.brMultY) : 1
}
// Bottom-right corner arc
PathArc {
relativeX: -root.brRadius * root.brMultX
relativeY: root.brRadius * root.brMultY
radiusX: root.brRadius
radiusY: root.brRadius
relativeX: root.isRenderable ? (-root.brRadius * root.brMultX) : 0
relativeY: root.isRenderable ? (root.brRadius * root.brMultY) : 0
radiusX: root.isRenderable ? root.brRadius : 0
radiusY: root.isRenderable ? root.brRadius : 0
direction: ShapeCornerHelper.getArcDirection(root.brMultX, root.brMultY)
}
// Bottom edge (moving left)
PathLine {
relativeX: -(root.panelWidth - root.brRadius * root.brMultX - root.blRadius * root.blMultX)
relativeX: root.isRenderable ? (-(root.panelWidth - root.brRadius * root.brMultX - root.blRadius * root.blMultX)) : -1
relativeY: 0
}
// Bottom-left corner arc
PathArc {
relativeX: -root.blRadius * root.blMultX
relativeY: -root.blRadius * root.blMultY
radiusX: root.blRadius
radiusY: root.blRadius
relativeX: root.isRenderable ? (-root.blRadius * root.blMultX) : 0
relativeY: root.isRenderable ? (-root.blRadius * root.blMultY) : 0
radiusX: root.isRenderable ? root.blRadius : 0
radiusY: root.isRenderable ? root.blRadius : 0
direction: ShapeCornerHelper.getArcDirection(root.blMultX, root.blMultY)
}
// Left edge (moving up) - closes the path back to start
PathLine {
relativeX: 0
relativeY: -(root.panelHeight - root.blRadius * root.blMultY - root.tlRadius * root.tlMultY)
relativeY: root.isRenderable ? (-(root.panelHeight - root.blRadius * root.blMultY - root.tlRadius * root.tlMultY)) : -1
}
// Top-left corner arc (back to start)
PathArc {
relativeX: root.tlRadius * root.tlMultX
relativeY: -root.tlRadius * root.tlMultY
radiusX: root.tlRadius
radiusY: root.tlRadius
relativeX: root.isRenderable ? (root.tlRadius * root.tlMultX) : 0
relativeY: root.isRenderable ? (-root.tlRadius * root.tlMultY) : 0
radiusX: root.isRenderable ? root.tlRadius : 0
radiusY: root.isRenderable ? root.tlRadius : 0
direction: ShapeCornerHelper.getArcDirection(root.tlMultX, root.tlMultY)
}
}
+1
View File
@@ -26,6 +26,7 @@ Item {
anchors.fill: parent
preferredRendererType: Shape.CurveRenderer
enabled: false // Disable mouse input
visible: cornersPath.cornerRadius > 0 && width > 0 && height > 0
ShapePath {
id: cornersPath
@@ -198,6 +198,7 @@ Variants {
y: -radius
width: launcherPanel.width + radius * 2
height: launcherPanel.height + radius * 2
visible: panelW > 0 && panelH > 0
opacity: launcherPanel.opacity
layer.enabled: true
+1
View File
@@ -4,6 +4,7 @@ import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Services.Power
import qs.Services.Theming
import qs.Services.UI
+32 -2
View File
@@ -14,12 +14,19 @@ Item {
property bool showMinimumSignal: false
property real minimumSignalValue: 0.05 // Default to 5% of height
// Safe degenerate-path fallback: valid off-screen line that renders nothing visible.
// Bare move-to paths like "M 0 0" can crash Qt's CurveRenderer triangulation.
readonly property string _safeFallbackPath: "M -1 -1 L -1 0"
// Reactive path that updates when values change
readonly property string svgPath: {
if (!values || !Array.isArray(values) || values.length === 0) {
return "M 0 0"; // Valid no-op path to avoid Qt triangulator crash on empty path
return _safeFallbackPath;
}
if (!isFinite(width) || !isFinite(height) || width <= 0 || height <= 0)
return _safeFallbackPath;
// Apply minimum signal if enabled
const processedValues = showMinimumSignal ? values.map(v => v === 0 ? minimumSignalValue : v) : values;
@@ -28,28 +35,42 @@ Item {
const mirroredValues = partToMirror.concat(processedValues);
if (mirroredValues.length < 2) {
return "M 0 0"; // Valid no-op path to avoid Qt triangulator crash on empty path
return _safeFallbackPath;
}
const count = mirroredValues.length;
for (let i = 0; i < count; i++) {
if (!isFinite(mirroredValues[i]))
return _safeFallbackPath;
}
if (vertical) {
const stepY = height / (count - 1);
const centerX = width / 2;
const amplitude = width / 2;
if (!isFinite(stepY) || !isFinite(centerX) || !isFinite(amplitude))
return _safeFallbackPath;
let xOffset = mirroredValues[0] * amplitude;
if (!isFinite(xOffset))
return _safeFallbackPath;
let path = `M ${centerX - xOffset} 0`;
for (let i = 1; i < count; i++) {
const y = i * stepY;
xOffset = mirroredValues[i] * amplitude;
if (!isFinite(y) || !isFinite(xOffset))
return _safeFallbackPath;
path += ` L ${centerX - xOffset} ${y}`;
}
for (let i = count - 1; i >= 0; i--) {
const y = i * stepY;
xOffset = mirroredValues[i] * amplitude;
if (!isFinite(y) || !isFinite(xOffset))
return _safeFallbackPath;
path += ` L ${centerX + xOffset} ${y}`;
}
@@ -59,18 +80,27 @@ Item {
const centerY = height / 2;
const amplitude = height / 2;
if (!isFinite(stepX) || !isFinite(centerY) || !isFinite(amplitude))
return _safeFallbackPath;
let yOffset = mirroredValues[0] * amplitude;
if (!isFinite(yOffset))
return _safeFallbackPath;
let path = `M 0 ${centerY - yOffset}`;
for (let i = 1; i < count; i++) {
const x = i * stepX;
yOffset = mirroredValues[i] * amplitude;
if (!isFinite(x) || !isFinite(yOffset))
return _safeFallbackPath;
path += ` L ${x} ${centerY - yOffset}`;
}
for (let i = count - 1; i >= 0; i--) {
const x = i * stepX;
yOffset = mirroredValues[i] * amplitude;
if (!isFinite(x) || !isFinite(yOffset))
return _safeFallbackPath;
path += ` L ${x} ${centerY + yOffset}`;
}
+1
View File
@@ -93,6 +93,7 @@ Slider {
anchors.centerIn: parent
width: root.trackWidth
height: bgContainer.height
visible: root.trackWidth > 0 && bgContainer.height > 0
preferredRendererType: Shape.CurveRenderer
ShapePath {
+1
View File
@@ -41,6 +41,7 @@ Slider {
// Background track
Shape {
anchors.fill: parent
visible: bgContainer.width > 0 && bgContainer.height > 0
preferredRendererType: Shape.CurveRenderer
ShapePath {