about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-15 08:53:34 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-15 08:53:34 -0700
commita40d2c424e6ca2c0e92890c0ec4a30e7fb6d1a11 (patch)
tree0fca08417f0d8cab6c8218b25681603eb50d1274
parent2586b84899676b7d782fda8639036fc06410425a (diff)
downloadtext.love-a40d2c424e6ca2c0e92890c0ec4a30e7fb6d1a11.tar.gz
standardize on ordering of cases
-rw-r--r--drawing.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/drawing.lua b/drawing.lua
index 6ed50ce..a593d90 100644
--- a/drawing.lua
+++ b/drawing.lua
@@ -366,7 +366,7 @@ function Drawing.keychord_pressed(chord)
       if drawing.pending.vertices == nil then
         drawing.pending.vertices = {drawing.pending.p1}
       end
-    elseif drawing.pending.mode == 'square' or drawing.pending.mode == 'rectangle' then
+    elseif drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then
       -- reuse existing vertices
     elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
       drawing.pending.vertices = {drawing.pending.center}
@@ -383,10 +383,10 @@ function Drawing.keychord_pressed(chord)
       if drawing.pending.vertices == nil then
         drawing.pending.vertices = {drawing.pending.p1}
       end
-    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
-      drawing.pending.vertices = {drawing.pending.center}
     elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'square' then
       -- reuse existing (1-2) vertices
+    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
+      drawing.pending.vertices = {drawing.pending.center}
     end
     drawing.pending.mode = 'rectangle'
   elseif chord == 'C-s' and not App.mouse_down(1) then
@@ -400,14 +400,14 @@ function Drawing.keychord_pressed(chord)
       if drawing.pending.vertices == nil then
         drawing.pending.vertices = {drawing.pending.p1}
       end
-    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
-      drawing.pending.vertices = {drawing.pending.center}
-    elseif drawing.pending.mode == 'rectangle' then
-      -- reuse existing (1-2) vertices
     elseif drawing.pending.mode == 'polygon' then
       while #drawing.pending.vertices > 2 do
         table.remove(drawing.pending.vertices)
       end
+    elseif drawing.pending.mode == 'rectangle' then
+      -- reuse existing (1-2) vertices
+    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
+      drawing.pending.vertices = {drawing.pending.center}
     end
     drawing.pending.mode = 'square'
   elseif App.mouse_down(1) and chord == 'p' and Current_drawing_mode == 'polygon' then
@@ -449,10 +449,10 @@ function Drawing.keychord_pressed(chord)
     local _,drawing = Drawing.current_drawing()
     if drawing.pending.mode == 'freehand' then
       drawing.pending.p1 = Drawing.insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y)
-    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
-      drawing.pending.p1 = drawing.pending.center
     elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then
       drawing.pending.p1 = drawing.pending.vertices[1]
+    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
+      drawing.pending.p1 = drawing.pending.center
     end
     drawing.pending.mode = 'line'
   elseif chord == 'C-l' and not App.mouse_down(1) then