move gears along their axis with the mousewheel
[antikythera] / src / main.cc
index f98f190..ce8466e 100644 (file)
@@ -215,6 +215,14 @@ static void mouse(int bn, int st, int x, int y)
                        sel_gear = 0;
                }
        }
                        sel_gear = 0;
                }
        }
+
+       if(bidx == 3 || bidx == 4) {    /* wheel */
+               if(hover_gear) {
+                       float dz = bidx == 4 ? 1 : -1;
+                       hover_gear->set_position(hover_gear->get_position() + hover_gear->get_axis() * dz);
+                       machine->invalidate_meshing();
+               }
+       }
 }
 
 static void motion(int x, int y)
 }
 
 static void motion(int x, int y)