You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I noticed that in the latest Git version of Raylib, the line drawing function is no longer pixel-perfect, which is reflected in the following aspects:
The DrawRectangleLines function no longer perfectly encloses its region, where an additional pixel is added in the vertical direction.
In a 2D game that utilizes normalized coordinates along with Camera2D (which is common for tile-based games as it decouples the game's coordinates from the tile size), line drawing functions like DrawLine and DrawLineV produce incorrect results with a 0.5 offset in both dimensions.
The result of the above code under the Git version of Raylib:
The result of the above code under Raylib 5.0:
I noticed that the changes causing these issues may have been made to address other problems in the recent commits, so perhaps some trade-offs in design need to be considered.
The text was updated successfully, but these errors were encountered:
I noticed that the changes causing these issues may have been made to address other problems in the recent commits, so perhaps some trade-offs in design need to be considered.
@bohonghuang Yes, this is the issue it tried to address: #3884. And it also break some projects for me...
One solution could be using DrawRectangleLinesEx(), that still uses RL_QUADS but all DrawRectangleLines() could still fail. Also note that the pixel offset is GPU/driver dependant so it could be very difficult to properly address.
Other possible solution is enabling a flag (like previous implementation) to force RL_QUADS when required.
Please, before submitting a new issue verify and check:
Issue description
Hello! I noticed that in the latest Git version of Raylib, the line drawing function is no longer pixel-perfect, which is reflected in the following aspects:
DrawRectangleLines
function no longer perfectly encloses its region, where an additional pixel is added in the vertical direction.Camera2D
(which is common for tile-based games as it decouples the game's coordinates from the tile size), line drawing functions likeDrawLine
andDrawLineV
produce incorrect results with a 0.5 offset in both dimensions.Code Example
Here is the code for the issue demonstration:
Issue Screenshot
The result of the above code under the Git version of Raylib:
The result of the above code under Raylib 5.0:
I noticed that the changes causing these issues may have been made to address other problems in the recent commits, so perhaps some trade-offs in design need to be considered.
The text was updated successfully, but these errors were encountered: