Quellcode durchsuchen

now i fixed the accuracy issues

naelstrof vor 10 Jahren
Ursprung
Commit
46092fa6f9
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2
    2
      main.cpp

+ 2
- 2
main.cpp Datei anzeigen

133
                     break;
133
                     break;
134
                 }
134
                 }
135
                 // Check to make sure the user actually wants to drag for a selection before creating a rectangle.
135
                 // Check to make sure the user actually wants to drag for a selection before creating a rectangle.
136
-                int w = xengine->m_mousex - cx;
137
-                int h = xengine->m_mousey - cy;
136
+                int w = xengine->m_mousex - cx + 1;
137
+                int h = xengine->m_mousey - cy + 1;
138
                 if ( ( std::abs( w ) > tolerance || std::abs( h ) > tolerance ) && !selection ) {
138
                 if ( ( std::abs( w ) > tolerance || std::abs( h ) > tolerance ) && !selection ) {
139
                     selection = new slop::Rectangle( cx, cy, 0, 0, borderSize, padding, r, g, b );
139
                     selection = new slop::Rectangle( cx, cy, 0, 0, borderSize, padding, r, g, b );
140
                     xengine->addRect( selection );
140
                     xengine->addRect( selection );