Vladar4 / sdl2_nim

Wrapper of the SDL 2 library for the Nim language.
Other
147 stars 24 forks source link

Bug drawing Rect #34

Closed PrimaIVoid closed 3 years ago

PrimaIVoid commented 3 years ago

I noticed in some of the examples and then tested it myself that sometime drawing a Rectangle shows 1 pixel offset in the bottom line of the rectangle,. Only the first or second half of that line seems to be affected though. renderDrawRect produces this bug but FilledRect or other shapes does not

   setRenderDrawColor(app.renderer, 0, 99, 99, 0)
    var rect = Rect(x: 10, y: 30, w: 160, h: 60)
    renderDrawRect(app.renderer, addr rect)

rect

Vladar4 commented 3 years ago

Can't reproduce.

Looks like a driver-depended or hardware-compatibility SDL library issue, considering that sdl2_nim just wraps these functions' calls: https://github.com/Vladar4/sdl2_nim/blob/master/sdl2/private/render.nim#L889

P.S.: Maybe try to recreate the same rects in C without any wrappers. If the glitch persists, you'll know for sure that it's clearly an SDL2 issue.

PrimaIVoid commented 3 years ago

Found this Bug in some other discussions online, even if its rare. I'm not even sure why has not been adressed yet or what may be the cause, but yes, its not related to the bindings but a problem even with original SDL2 libraries, so i'm closing this issue