Skip to content

Commit

Permalink
engine: more fanning handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Nov 20, 2019
1 parent c866a3f commit 2de5bdc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
18 changes: 3 additions & 15 deletions engine/src/qlcpalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,25 +337,13 @@ qreal QLCPalette::valueFactor(qreal progress)
break;
case Sine:
{
//qreal degrees = (progress * 3.6) + 270;


qreal degrees = (progress * 360.0) + 270.0;
factor = qSin(normalizedAmount * qDegreesToRadians(degrees)) + 1.0;
}
break;
case Square:
{
if (normalizedAmount < 1.0)
{
factor = progress < normalizedAmount ? 0.0 : 1.0;
}
else if (normalizedAmount > 1.0)
{

}
else
{
factor = progress < 0.5 ? 0.0 : 1.0;
}
factor = qSin(normalizedAmount * qDegreesToRadians(progress * 360.0)) < 0 ? 1 : 0;
}
break;
case Saw:
Expand Down
9 changes: 8 additions & 1 deletion qmlui/qml/PaletteFanningBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,14 @@ Rectangle
to: 1000
value: boxRoot.palette ? boxRoot.palette.fanningAmount : 100
suffix: "%"
onValueChanged: boxRoot.palette.fanningAmount = value
onValueChanged:
{
if (boxRoot.palette)
{
boxRoot.palette.fanningAmount = value
boxRoot.updatePreview()
}
}
}

// row 4
Expand Down

0 comments on commit 2de5bdc

Please sign in to comment.