lovebrew / lovepotion

LÖVE for Nintendo Homebrew
https://lovebrew.org
Other
552 stars 42 forks source link

[BUG] Translation and size is wrong when drawing roundrectangles #141

Closed Nehemek closed 3 years ago

Nehemek commented 3 years ago

Describe the bug

When drawing roundrectangles the shape has the wrong width and height and is drawn at the wrong x and y coordinates. It appears that the the radius is added twice to the width and height of the roundrect and also the shape is offset by the negative the radius too.

Expected behavior

The total width and height should account for the radius provided for the roundrectangle. The starting coordinates should also correspond to the ones specified on the function.

Relevant Code To Reproduce

This line will draw a rectangle at 10,10 with a width and height of 20: love.graphics.rectangle("fill",10,10,20,20)

This line wil wrongly draw a round rectangle at 0,0 width a width and height of 40: love.graphics.rectangle("fill",10,10,20,20,10,10)

System Info [Please complete the following information]:

System: 3ds v11.14.0-46U CFW: Luma v10.2.1 Method of execution: Homebrew App LÖVE Potion version: 2.1.0 (development version)

TurtleP commented 3 years ago

Fixed with commit cba0409