瀏覽代碼

fixed some inaccuracies

naelstrof 7 年之前
父節點
當前提交
cbe27ff04b
共有 2 個檔案被更改,包括 13 行新增6 行删除
  1. 1
    1
      src/slop.cpp
  2. 12
    5
      src/slopstates.cpp

+ 1
- 1
src/slop.cpp 查看文件

@@ -138,5 +138,5 @@ SlopSelection SlopSelect( SlopOptions* options, bool* cancelled ) {
138 138
         delete options;
139 139
     }
140 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 查看文件

@@ -47,15 +47,22 @@ void SlopStartDrag::onEnter( SlopMemory& memory ) {
47 47
 }
48 48
 
49 49
 void SlopStartDrag::update( SlopMemory& memory, double dt ) {
50
-    memory.rectangle->setPoints(startPoint, mouse->getMousePos());
51 50
     char a = startPoint.y > mouse->getMousePos().y;
52 51
     char b = startPoint.x > mouse->getMousePos().x;
53 52
     char c = (a << 1) | b;
54 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 67
     if ( !mouse->getButton( 1 ) ) {
61 68
         memory.setState( (SlopState*)new SlopEndDrag() );