diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-05-21 08:20:55 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-05-21 08:20:55 -0700 |
commit | f42c3f8181afe5cd3a99c372175da86ac7fda9d0 (patch) | |
tree | 5bd01a6709688445d5e769956ba61da856df0aef | |
parent | 95e17dac2f81c64d915a40b4d0e7be5f0df48c1f (diff) | |
download | text.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.lua | 12 |
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: |