[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [spectacle/Applications/16.04] src/QuickEditor: Fix high dpi region selection.
From:       Weng Xuetian <wengxt () gmail ! com>
Date:       2016-05-08 16:12:15
Message-ID: E1azRJX-0002Va-SX () scm ! kde ! org
[Download RAW message or body]

Git commit 38804556588e977aaaea5f50115363d9f4dc379d by Weng Xuetian.
Committed on 08/05/2016 at 16:11.
Pushed by xuetianweng into branch 'Applications/16.04'.

Fix high dpi region selection.

Coordinates need to be scaled to native pixel before clip.

REVIEW: 127814
CCBUG: 357022

M  +8    -2    src/QuickEditor/EditorRoot.qml

http://commits.kde.org/kscreengenie/38804556588e977aaaea5f50115363d9f4dc379d

diff --git a/src/QuickEditor/EditorRoot.qml b/src/QuickEditor/EditorRoot.qml
index f7fb33b..4ef0784 100644
--- a/src/QuickEditor/EditorRoot.qml
+++ b/src/QuickEditor/EditorRoot.qml
@@ -51,7 +51,10 @@ Item {
 =

     Keys.onReturnPressed: {
         if (selection) {
-            acceptImage(selection.x, selection.y, selection.width, selecti=
on.height);
+            acceptImage(selection.x * Screen.devicePixelRatio,
+                        selection.y * Screen.devicePixelRatio,
+                        selection.width * Screen.devicePixelRatio,
+                        selection.height * Screen.devicePixelRatio);
         } else {
             acceptImage(-1, -1, -1, -1);
         }
@@ -253,7 +256,10 @@ Item {
             imageElement: imageBackground;
 =

             onDoubleClicked: {
-                editorRoot.acceptImage(selection.x, selection.y, selection=
.width, selection.height);
+                editorRoot.acceptImage(selection.x * Screen.devicePixelRat=
io,
+                                       selection.y * Screen.devicePixelRat=
io,
+                                       selection.width * Screen.devicePixe=
lRatio,
+                                       selection.height * Screen.devicePix=
elRatio);
             }
         }
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic