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) {
|
void Window::show_image(const Image& image) {
|
||||||
// create texture from surface
|
// create texture from surface
|
||||||
_t.reset(SDL_CreateTextureFromSurface(_r.get(), image.surface()));
|
_t.reset(SDL_CreateTextureFromSurface(_r.get(), image.surface()));
|
||||||
|
/*
|
||||||
// get screen size, to scale down if image is too big
|
// get screen size, to scale down if image is too big
|
||||||
int w {image.width()};
|
int w {image.width()};
|
||||||
int h {image.height()};
|
int h {image.height()};
|
||||||
@ -136,7 +136,12 @@ void Window::show_image(const Image& image) {
|
|||||||
h = static_cast<int>(round(w / image_ratio));
|
h = static_cast<int>(round(w / image_ratio));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_size(w, h);
|
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) {
|
void Window::add_event_handler(WindowEventHandler handler, SDL_WindowEventID type) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user