Fix visuals for stateful garage doors
This commit is contained in:
parent
71fcec2486
commit
1686c3c9be
@ -60,9 +60,18 @@ Item {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height + Style.margins
|
height: parent.height + Style.margins
|
||||||
anchors.verticalCenterOffset: root.percentageState
|
anchors.verticalCenterOffset: {
|
||||||
? -height * (1 - (root.percentageState.value / 100))
|
if (root.percentageState) {
|
||||||
: -height / 2
|
return -height * (1 - (root.percentageState.value / 100))
|
||||||
|
}
|
||||||
|
if (root.stateState && root.stateState.value === "closed") {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if (root.stateState && root.stateState.value === "open") {
|
||||||
|
return -height
|
||||||
|
}
|
||||||
|
return -height / 2
|
||||||
|
}
|
||||||
onPaint: {
|
onPaint: {
|
||||||
var ctx = getContext("2d");
|
var ctx = getContext("2d");
|
||||||
ctx.reset();
|
ctx.reset();
|
||||||
|
|||||||
Reference in New Issue
Block a user