Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_RenderDrawLine draws last point at 0,0 #3521

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

SDL_RenderDrawLine draws last point at 0,0 #3521

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.10
Reported for operating system, platform: Windows 10, x86

Comments on the original bug report:

On 2020-01-24 10:47:31 +0000, Richard Russell wrote:

Created attachment 4173
Shows incorrect behavior in SDL 2.0.10 (Windows)

SDL_RenderDrawLine draws the final point at coordinates (0,0) rather than in the correct place. Superficially it appears that the line is shorter than it should be (the docs state "SDL_RenderDrawLine() draws the line to include both end points") but in fact the last pixel is drawn, just in the wrong place!

This is a regression in SDL 2.0.10, so I don't think it is a duplicate of any of the other SDL_RenderDrawLine bugs. I have attached images showing what happens, enlarged for clarity, in 2.0.9 and 2.0.10 on Windows and in 2.0.10 on MacOS.

On 2020-01-24 10:48:50 +0000, Richard Russell wrote:

Created attachment 4174
Shows incorect behavior in SDL 2.0.10 (MacOS)

On 2020-01-24 10:49:55 +0000, Richard Russell wrote:

Created attachment 4175
Shows correct behavior in SDL 2.0.9 (Windows)

On 2020-01-24 17:26:14 +0000, Richard Russell wrote:

Created attachment 4176
Beginning and end points swapped (2.0.10)

This is what happens if you swap the beginning and end of the line, confirming that it's the last point (here 3,3) that gets plotted incorrectly at 0,0.

On 2020-01-25 02:50:24 +0000, Sam Lantinga wrote:

Ryan, can you look at this? This code seems suspicious...
data->glVertex2f(verts[(count-1)2], verts[(count2)-1]);

On 2020-01-25 10:14:26 +0000, Richard Russell wrote:

(In reply to Sam Lantinga from comment # 4)

This code seems suspicious...
data->glVertex2f(verts[(count-1)2], verts[(count2)-1]);

Sorry to interject, but it could be right when you consider it's equivalent to:

data->glVertex2f(verts[(count2)-2], verts[(count2)-1]);

On 2020-01-25 15:34:35 +0000, Richard Russell wrote:

Somebody kindly sent me a DLL of SDL 2.0.11 to try (see the related thread at the forum) and the issue seems to be fixed there. So although a search of Bugzilla didn't find any reference to this specific bug, it seems that it has been addressed.

On 2020-01-25 20:05:15 +0000, Sam Lantinga wrote:

Okay, thanks for letting us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant