about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-21 08:20:55 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-21 08:20:55 -0700
commitf42c3f8181afe5cd3a99c372175da86ac7fda9d0 (patch)
tree5bd01a6709688445d5e769956ba61da856df0aef
parent95e17dac2f81c64d915a40b4d0e7be5f0df48c1f (diff)
downloadlines.love-f42c3f8181afe5cd3a99c372175da86ac7fda9d0.tar.gz
bugfix
Looks like I never retested rectangles after I implemented drawing
squares, even though I made changes to the rectangle implementation :/
-rw-r--r--drawing.lua12
1 files changed, 2 insertions, 10 deletions
diff --git a/drawing.lua b/drawing.lua
index 16ffe6f..cb5ec6f 100644
--- a/drawing.lua
+++ b/drawing.lua
@@ -502,18 +502,10 @@ end
 
 function Drawing.complete_rectangle(firstx,firsty, secondx,secondy, x,y)
   if firstx == secondx then
-    local thirdx = y
-    local thirdy = secondy
-    love.graphics.line(Drawing.pixels(secondx)+left,Drawing.pixels(secondy)+top, Drawing.pixels(thirdx)+left,Drawing.pixels(thirdy)+top)
-    love.graphics.line(Drawing.pixels(thirdx)+left,Drawing.pixels(thirdy)+top, Drawing.pixels(thirdx)+left,Drawing.pixels(firsty)+top)
-    return thirdx,thirdy, thirdx,firsty
+    return x,secondy, x,firsty
   end
   if firsty == secondy then
-    local thirdx = secondx
-    local thirdy = y
-    love.graphics.line(Drawing.pixels(secondx)+left,Drawing.pixels(secondy)+top, Drawing.pixels(thirdx)+left,Drawing.pixels(thirdy)+top)
-    love.graphics.line(Drawing.pixels(thirdx)+left,Drawing.pixels(thirdy)+top, Drawing.pixels(firstx)+left,Drawing.pixels(thirdy)+top)
-    return
+    return secondx,y, firstx,y
   end
   local first_slope = (secondy-firsty)/(secondx-firstx)
   -- slope of second edge: