Merge PR #880: Fix zigbee topology map pinch area

This commit is contained in:
jenkins 2022-09-11 13:11:58 +02:00
commit df839ab277

View File

@ -436,6 +436,21 @@ Page {
} }
PinchArea {
anchors.fill: parent
property double startScale: 0
onPinchStarted: {
startScale = root.scale
print("pinch started", startScale)
}
onPinchUpdated: {
print("pinch updated:", pinch.scale)
var scaleDiff = pinch.scale - 1
root.scale = Math.min(root.maxScale, Math.max(root.minScale, startScale + scaleDiff))
root.reload()
}
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
@ -470,21 +485,8 @@ Page {
} }
} }
} }
PinchArea {
anchors.fill: parent
property double scaleOffset: 0
onPinchStarted: {
scaleOffset = 1 - root.scale
print("pinch started", offset)
} }
onPinchUpdated: {
print("pinch updated:", pinch.scale)
root.scale = Math.min(root.maxScale, Math.max(root.minScale, pinch.scale + scaleOffset))
root.reload()
}
}
} }
} }