]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Oops. Fix grid lock when zoomed in or out.
authorfnargwibble@gmail.com <fnargwibble@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 21 Jan 2012 14:32:39 +0000 (14:32 +0000)
committerfnargwibble@gmail.com <fnargwibble@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 21 Jan 2012 14:32:39 +0000 (14:32 +0000)
client/proxguiqt.cpp

index 2c6894193ae44f21b12c44b06e5a068b2f2fe955..4e57fecc7ff8754cb46f30f84d64b2decc6daee3 100644 (file)
@@ -134,7 +134,7 @@ void ProxWidget::paintEvent(QPaintEvent *event)
         // plot X and Y grid lines
         int i;
         if ((PlotGridX > 0) && ((PlotGridX * GraphPixelsPerPoint) > 1)) {
-               for(i = 40 + GridOffset; i < r.right(); i += (int)(PlotGridX * GraphPixelsPerPoint)) {
+               for(i = 40 + (GridOffset * GraphPixelsPerPoint); i < r.right(); i += (int)(PlotGridX * GraphPixelsPerPoint)) {
                        //SelectObject(hdc, GreyPenLite);
                        //MoveToEx(hdc, r.left + i, r.top, NULL);
                        //LineTo(hdc, r.left + i, r.bottom);
@@ -330,9 +330,9 @@ void ProxWidget::keyPressEvent(QKeyEvent *event)
                                        GridOffset -= (int)(20 / GraphPixelsPerPoint);
                                GraphStart += (int)(20 / GraphPixelsPerPoint);
                        } else {
-                               GraphStart++;
                                if (GridLocked && GraphStart < startMax)
                                        GridOffset--;
+                               GraphStart++;
                        }
                        if(GridOffset < 0)
                                GridOffset += PlotGridX;
@@ -346,9 +346,9 @@ void ProxWidget::keyPressEvent(QKeyEvent *event)
                                        GridOffset += (int)(20 / GraphPixelsPerPoint);
                                GraphStart -= (int)(20 / GraphPixelsPerPoint);
                        } else {
-                               GraphStart--;
                                if (GridLocked && GraphStart > 0)
                                        GridOffset++;
+                               GraphStart--;
                        }
                        if (PlotGridX)
                                GridOffset %= PlotGridX;
Impressum, Datenschutz