Skip to content

Commit

Permalink
style(qml): Improve readability of pre-/postroll drawing code
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Feb 17, 2024
1 parent adf4645 commit b0b4d2f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions res/qml/WaveformRow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ Item {
paths: {
let p = [];
for (let i = 0; i < preroll.numTriangles; i++) {
p.push([Qt.point(preroll.width - i * preroll.triangleWidth, preroll.triangleHeight / 2), Qt.point(preroll.width - (i + 1) * preroll.triangleWidth, 0), Qt.point(preroll.width - (i + 1) * preroll.triangleWidth, preroll.triangleHeight), Qt.point(preroll.width - i * preroll.triangleWidth, preroll.triangleHeight / 2)]);
p.push([
Qt.point(preroll.width - i * preroll.triangleWidth, preroll.triangleHeight / 2),
Qt.point(preroll.width - (i + 1) * preroll.triangleWidth, 0),
Qt.point(preroll.width - (i + 1) * preroll.triangleWidth, preroll.triangleHeight),
Qt.point(preroll.width - i * preroll.triangleWidth, preroll.triangleHeight / 2),
]);
}
return p;
}
Expand Down Expand Up @@ -180,7 +185,12 @@ Item {
paths: {
let p = [];
for (let i = 0; i < postroll.numTriangles; i++) {
p.push([Qt.point(i * postroll.triangleWidth, postroll.triangleHeight / 2), Qt.point((i + 1) * postroll.triangleWidth, 0), Qt.point((i + 1) * postroll.triangleWidth, postroll.triangleHeight), Qt.point(i * postroll.triangleWidth, postroll.triangleHeight / 2)]);
p.push([
Qt.point(i * postroll.triangleWidth, postroll.triangleHeight / 2),
Qt.point((i + 1) * postroll.triangleWidth, 0),
Qt.point((i + 1) * postroll.triangleWidth, postroll.triangleHeight),
Qt.point(i * postroll.triangleWidth, postroll.triangleHeight / 2),
]);
}
return p;
}
Expand Down

0 comments on commit b0b4d2f

Please sign in to comment.