veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.21k stars 221 forks source link

CopyExF ignores src rect #458

Open snakeru opened 4 years ago

snakeru commented 4 years ago

It seems that the F variant of CopyEx ignores the source rectangle.

This code renderer.CopyEx(texture, &sdl.Rect{W: 60, H: 60}, nil, 0, nil, sdl.FLIP_NONE) correctly renders the cropped texture full-screen.

This code however renderer.CopyExF(texture, &sdl.FRect{W: 60, H: 60}, nil, 0, nil, sdl.FLIP_NONE) renders the whole texture full-screen.

veeableful commented 4 years ago

Hi @snakeru, I'm sorry for the wait. I have pushed the fix up to the master branch. Could you please test it out and let me know if it solves the issue? Once it's confirmed to be fixed on your side, I will immediately tag it as the next patch release!

snakeru commented 4 years ago

Hi @veeableful. You call that a wait??? Frankly, I thought that this is an upstream bug and therefore it will take months to be fixed.

Anyway, it works now. Many thanks! you can include this into your next release.

veeableful commented 4 years ago

Haha I usually try to respond within two days so it's a relief that you didn't wait long 😃

In any case, I have pushed it as v0.4.2!

Schobers commented 4 years ago

Added PR #460 for the Renderer.CopyF signature.

veeableful commented 4 years ago

Hi @Schobers, thank you so much! I have merged the commit and tagged it as the next patch release.