Ver código fonte

Improved detection of selecting the very bottom row or the very right column of pixels.

Dalton Nell 9 anos atrás
pai
commit
e296d29736
2 arquivos alterados com 5 adições e 5 exclusões
  1. 4
    4
      main.cpp
  2. 1
    1
      options.cpp

+ 4
- 4
main.cpp Ver arquivo

@@ -185,11 +185,11 @@ int main( int argc, char** argv ) {
185 185
                 }
186 186
                 // We're 100% accurate, but the mouse can't select the very bottom row or very right column of pixels.
187 187
                 // We detect if either are 1 pixel off and attempt to correct it.
188
-                if ( w == xengine->getWidth() - 1 ) {
189
-                    w = xengine->getWidth();
188
+                if ( cx + w == xengine->getWidth() - 1 ) {
189
+                    w = xengine->getWidth() - cx;
190 190
                 }
191
-                if ( h == xengine->getHeight() - 1 ) {
192
-                    h = xengine->getHeight();
191
+                if ( cy + h == xengine->getHeight() - 1 ) {
192
+                    h = xengine->getHeight() - cy;
193 193
                 }
194 194
                 // Set the selection rectangle's dimensions to mouse movement.
195 195
                 // We use the function setDim since rectangles can't have negative widths,

+ 1
- 1
options.cpp Ver arquivo

@@ -3,7 +3,7 @@
3 3
 slop::Options* options = new slop::Options();
4 4
 
5 5
 slop::Options::Options() {
6
-    m_version = "v2.0.4";
6
+    m_version = "v2.0.5";
7 7
     m_borderSize = 10;
8 8
     m_padding = 0;
9 9
     m_xdisplay = ":0";