Rinnegatamante / lpp-vita

Lua Player Plus for PSVITA. Documentation on: http://rinnegatamante.github.io/lpp-vita/
GNU General Public License v3.0
179 stars 27 forks source link

Graphics.fillEmptyRect does not draw its lines properly. #29

Closed NoName9138 closed 6 years ago

NoName9138 commented 6 years ago

In the function lua_emptyrect in C++, the function vita2d_draw_line is used to draw the outline of the defined rectangle.

vita2d_draw_line expects x1, y1, x2, y2, color as arguments. but in lua_emptyrect the following arguments are given

(x1), (y1), (difference between x2 and x1), (y1), color (x1), (y2), (difference between x2 and x1), (y2), color (x1), (y1), (x1), (difference between y2 and y1), color (x2), (y1), (x2), (difference between y2 and y1), color

example: if i want to draw a empty Rect from the coordinates x: 927, y: 64, to x: 959, y: 96

It will draw the following lines: x1: 927, y1: 64, x2: 32, y2: 64 x1: 927, y1: 96, x2: 32, y2: 64 x1: 927, y1: 64, x2: 959, y2: 32 x1: 959, y1: 64, x2: 959, y2: 32

Resulting in something, that locks like the attached ScreenShot the yellow rectangle in the picture are the same coordinates, but called with fillRect, instead of fillEmptyRect. 2017-10-13-054011

Rinnegatamante commented 6 years ago

Fixed with https://github.com/Rinnegatamante/lpp-vita/commit/98805e2dfdd1d3645dfc7041ebccedd39f7002b2