Pārlūkot izejas kodu

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

Dalton Nell 10 gadus atpakaļ
vecāks
revīzija
e296d29736
2 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 4
    4
      main.cpp
  2. 1
    1
      options.cpp

+ 4
- 4
main.cpp Parādīt failu

185
                 }
185
                 }
186
                 // We're 100% accurate, but the mouse can't select the very bottom row or very right column of pixels.
186
                 // We're 100% accurate, but the mouse can't select the very bottom row or very right column of pixels.
187
                 // We detect if either are 1 pixel off and attempt to correct it.
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
                 // Set the selection rectangle's dimensions to mouse movement.
194
                 // Set the selection rectangle's dimensions to mouse movement.
195
                 // We use the function setDim since rectangles can't have negative widths,
195
                 // We use the function setDim since rectangles can't have negative widths,

+ 1
- 1
options.cpp Parādīt failu

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