Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Alberto Mardegan
Lomiri VNC
Commits
a2f32b92
Commit
a2f32b92
authored
Dec 12, 2020
by
Alberto Mardegan
Browse files
QML, ViewerPage: primitive pinch and panning
parent
e372927b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
src/desktop/qml/ViewerPage.qml
src/desktop/qml/ViewerPage.qml
+23
-2
No files found.
src/desktop/qml/ViewerPage.qml
View file @
a2f32b92
...
...
@@ -10,8 +10,29 @@ Page {
title
:
qsTr
(
"
VNC Client - Viewer
"
)
VncOutput
{
id
:
viewer
PinchArea
{
property
real
initialScale
:
1.0
property
point
initialCenter
anchors.fill
:
parent
onPinchStarted
:
{
initialScale
=
viewer
.
scale
initialCenter
=
viewer
.
center
}
onPinchUpdated
:
{
var
requestedScale
=
initialScale
*
pinch
.
scale
var
diffX
=
(
pinch
.
center
.
x
-
pinch
.
startCenter
.
x
)
/
requestedScale
var
diffY
=
(
pinch
.
center
.
y
-
pinch
.
startCenter
.
y
)
/
requestedScale
viewer
.
scale
=
requestedScale
viewer
.
center
=
Qt
.
point
(
initialCenter
.
x
-
diffX
,
initialCenter
.
y
-
diffY
)
}
VncOutput
{
id
:
viewer
anchors.fill
:
parent
enabled
:
!
parent
.
pinch
.
active
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment