diff --git a/README.md b/README.md index d72ed73..8a29a90 100644 --- a/README.md +++ b/README.md @@ -91,21 +91,6 @@ found anything amiss: http://akkartik.name/contact * No clipping yet for drawings. In particular, circles/squares/rectangles and point labels can overflow a drawing. -* Insufficient handling of constraints when moving points. For example, if you - draw a manhattan line and then move one of the points, you may not be able - to hover on it anymore. - - There's two broad ways to fix this. The first is to relax constraints, - switch the manhattan line to not be manhattan. The second is to try to - maintain constraints. Either constrain the point to only move along one line - (but what if it's connected to two manhattan lines?!), or constrain the - other end of the line to move alongside. I'm not sure yet which would be - more useful. Getting into constraints would also make the program more - complex. - - Bottomline: at the moment moving points connected to manhattan lines, - rectangles or squares can break drawings in subtle ways. - * Touchpads can drag the mouse pointer using a light touch or a heavy click. On Linux, drags using the light touch get interrupted when a key is pressed. You'll have to press down to drag. diff --git a/drawing.lua b/drawing.lua index 9bf06c7..624fad7 100644 --- a/drawing.lua +++ b/drawing.lua @@ -248,6 +248,11 @@ function Drawing.update() elseif Current_drawing_mode == 'move' then if Drawing.in_drawing(drawing, x, y) then local mx,my = Drawing.coord(x-Margin_left), Drawing.coord(y-drawing.y) + if drawing.mode == 'manhattan' then + drawing.mode = 'line' + elseif drawing.mode == 'rectangle' or drawing.mode == 'square' then + drawing.mode = 'polygon' + end drawing.pending.target_point.x = mx drawing.pending.target_point.y = my end