https://bugs.kde.org/show_bug.cgi?id=431915

oioi5...@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|1                           |0
             Status|CONFIRMED                   |REPORTED
                 CC|                            |oioi5...@gmail.com

--- Comment #3 from oioi5...@gmail.com ---
I've tried fixing a bug, but I don't know how to report it.
Could someone adapt to the upstream?

 src/QuickEditor/QuickEditor.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/QuickEditor/QuickEditor.cpp b/src/QuickEditor/QuickEditor.cpp
index 277f831..4bb90c8 100644
--- a/src/QuickEditor/QuickEditor.cpp
+++ b/src/QuickEditor/QuickEditor.cpp
@@ -204,9 +204,10 @@ void QuickEditor::keyPressEvent(QKeyEvent *event)
             break;
         }
         const qreal step = (shiftPressed ? 1 : magnifierLargeStep);
-        const int newPos = boundsUp(qRound(mSelection.top() * devicePixelRatio
- step), false);
+        const int yPos = modifiers & Qt::AltModifier ? mSelection.bottom() :
mSelection.top();
+        const int newPos = boundsUp(qRound(yPos * devicePixelRatio - step),
false);
         if (modifiers & Qt::AltModifier) {
-            mSelection.setBottom(devicePixelRatioI * newPos +
mSelection.height());
+            mSelection.setBottom(devicePixelRatioI * newPos);
             mSelection = mSelection.normalized();
         } else {
             mSelection.moveTop(devicePixelRatioI * newPos);
@@ -222,7 +223,7 @@ void QuickEditor::keyPressEvent(QKeyEvent *event)
         const qreal step = (shiftPressed ? 1 : magnifierLargeStep);
         const int newPos = boundsRight(qRound(mSelection.left() *
devicePixelRatio + step), false);
         if (modifiers & Qt::AltModifier) {
-            mSelection.setRight(devicePixelRatioI * newPos +
mSelection.width());
+            mSelection.setRight(devicePixelRatioI * newPos +
mSelection.width() -1);
         } else {
             mSelection.moveLeft(devicePixelRatioI * newPos);
         }
@@ -237,7 +238,7 @@ void QuickEditor::keyPressEvent(QKeyEvent *event)
         const qreal step = (shiftPressed ? 1 : magnifierLargeStep);
         const int newPos = boundsDown(qRound(mSelection.top() *
devicePixelRatio + step), false);
         if (modifiers & Qt::AltModifier) {
-            mSelection.setBottom(devicePixelRatioI * newPos +
mSelection.height());
+            mSelection.setBottom(devicePixelRatioI * newPos +
mSelection.height() - 1);
         } else {
             mSelection.moveTop(devicePixelRatioI * newPos);
         }
@@ -250,9 +251,10 @@ void QuickEditor::keyPressEvent(QKeyEvent *event)
             break;
         }
         const qreal step = (shiftPressed ? 1 : magnifierLargeStep);
-        const int newPos = boundsLeft(qRound(mSelection.left() *
devicePixelRatio - step), false);
+        const int xPos = modifiers & Qt::AltModifier ? mSelection.right() :
mSelection.left();
+        const int newPos = boundsLeft(qRound(xPos * devicePixelRatio - step),
false);
         if (modifiers & Qt::AltModifier) {
-            mSelection.setRight(devicePixelRatioI * newPos +
mSelection.width());
+            mSelection.setRight(devicePixelRatioI * newPos);
             mSelection = mSelection.normalized();
         } else {
             mSelection.moveLeft(devicePixelRatioI * newPos);

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to