Browse Source

fixed some inaccuracies

naelstrof 7 years ago
parent
commit
cbe27ff04b
2 changed files with 13 additions and 6 deletions
  1. 1
    1
      src/slop.cpp
  2. 12
    5
      src/slopstates.cpp

+ 1
- 1
src/slop.cpp View File

138
         delete options;
138
         delete options;
139
     }
139
     }
140
     // Finally return the data.
140
     // Finally return the data.
141
-    return SlopSelection( output.x, output.y, output.z+1, output.w+1, memory.selectedWindow );
141
+    return SlopSelection( output.x, output.y, output.z, output.w, memory.selectedWindow );
142
 }
142
 }

+ 12
- 5
src/slopstates.cpp View File

47
 }
47
 }
48
 
48
 
49
 void SlopStartDrag::update( SlopMemory& memory, double dt ) {
49
 void SlopStartDrag::update( SlopMemory& memory, double dt ) {
50
-    memory.rectangle->setPoints(startPoint, mouse->getMousePos());
51
     char a = startPoint.y > mouse->getMousePos().y;
50
     char a = startPoint.y > mouse->getMousePos().y;
52
     char b = startPoint.x > mouse->getMousePos().x;
51
     char b = startPoint.x > mouse->getMousePos().x;
53
     char c = (a << 1) | b;
52
     char c = (a << 1) | b;
54
     switch ( c ) {
53
     switch ( c ) {
55
-        case 0: mouse->setCursor( XC_lr_angle ); break;
56
-        case 1: mouse->setCursor( XC_ll_angle ); break;
57
-        case 2: mouse->setCursor( XC_ur_angle ); break;
58
-        case 3: mouse->setCursor( XC_ul_angle ); break;
54
+        case 0: mouse->setCursor( XC_lr_angle );
55
+                memory.rectangle->setPoints(startPoint+glm::vec2(0,0), mouse->getMousePos()+glm::vec2(1,1));
56
+                break;
57
+        case 1: mouse->setCursor( XC_ll_angle );
58
+                memory.rectangle->setPoints(startPoint+glm::vec2(0,0), mouse->getMousePos()+glm::vec2(1,1));
59
+                break;
60
+        case 2: mouse->setCursor( XC_ur_angle );
61
+                memory.rectangle->setPoints(startPoint+glm::vec2(0,1), mouse->getMousePos()+glm::vec2(1,0));
62
+                break;
63
+        case 3: mouse->setCursor( XC_ul_angle );
64
+                memory.rectangle->setPoints(startPoint+glm::vec2(1,1), mouse->getMousePos()+glm::vec2(0,0));
65
+                break;
59
     }
66
     }
60
     if ( !mouse->getButton( 1 ) ) {
67
     if ( !mouse->getButton( 1 ) ) {
61
         memory.setState( (SlopState*)new SlopEndDrag() );
68
         memory.setState( (SlopState*)new SlopEndDrag() );