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

The ResizeHandler mentioned by changelog doesn't really exist yet #594

Closed
RybekU opened this issue Apr 8, 2020 · 3 comments · Fixed by #616
Closed

The ResizeHandler mentioned by changelog doesn't really exist yet #594

RybekU opened this issue Apr 8, 2020 · 3 comments · Fixed by #616
Labels
enhance-feature Create a new user-facing feature subsystem-graphics

Comments

@RybekU
Copy link

RybekU commented Apr 8, 2020

Describe the bug
The ResizeHandler module, which got introduced to help maintaining the same aspect ratio when the screen size changes isn't added as a module. It's not a simple case of just adding the module as it's not finished yet in the current form.

To Reproduce
Try to use ResizeHandler, really

Environment and versions:

  • Environment: any
  • Rust compiler version: any
  • Quicksilver version: latest development branch
@RybekU
Copy link
Author

RybekU commented Apr 8, 2020

Also, as a sidenote, the current interface it's only function has is

pub fn projection(&self, size: Vector) -> Transform

It seems to not be able to provide functionality for every single enum variant.
Some options would require using Graphics::set_viewport and not only Graphics::set_projection (which the current interface is implying).
I would like to hear an opinion of someone more experienced with this style of API first or maybe a new function interface proposition before I can prepare a pull request.

@RybekU
Copy link
Author

RybekU commented May 22, 2020

A heads up that I just basically have a copy-pasted/ported version of it from the previous quicksilver.
https://github.com/RybekU/Slimeu/blob/master/src/engine/resize_strategy.rs
It however doesn't set a projection (and i frankly have no idea how it can be achieved with just a projection, i find the Rectangle useful in the future to for example draw something that fills the space and looks nicely), but a Rectangle that should be used to make a new viewport (you can't make viewport from Rectangle so the actual usage is quite ugly, or at least couldn't back when I tried).
Usage example here: https://github.com/RybekU/Slimeu/blob/master/src/events.rs#L24.

If @ryanisaacg you are fine with how it works I could PR it once I have time to move my project to the current master alongside some minimalistic usage example.

@ryanisaacg
Copy link
Owner

I do think it should be possible to implement this solely with set_projection and without touching the viewport; once I've sat down and worked through some of the linear algebra I'll be a bit more confident in that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhance-feature Create a new user-facing feature subsystem-graphics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants