Setting image no longer resizes window
It caused bugs in more general cases. You should resize the window from app code when necessary.
This commit is contained in:
parent
f1e82f6126
commit
3db2099635
@ -118,7 +118,7 @@ void Window::update() {
|
||||
void Window::show_image(const Image& image) {
|
||||
// create texture from surface
|
||||
_t.reset(SDL_CreateTextureFromSurface(_r.get(), image.surface()));
|
||||
|
||||
/*
|
||||
// get screen size, to scale down if image is too big
|
||||
int w {image.width()};
|
||||
int h {image.height()};
|
||||
@ -136,8 +136,13 @@ void Window::show_image(const Image& image) {
|
||||
h = static_cast<int>(round(w / image_ratio));
|
||||
}
|
||||
}
|
||||
int ww, wh;
|
||||
SDL_GetWindowSize(_w.get(), &ww, &wh);
|
||||
if (ww != w || wh != h) {
|
||||
set_size(w, h);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void Window::add_event_handler(WindowEventHandler handler, SDL_WindowEventID type) {
|
||||
auto it = _event_handlers.find(type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user