From 68fe26613ae970d52588b3889e6a57288c01abb0 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Mon, 1 Feb 2021 13:13:32 +0100 Subject: [PATCH] Rmoved commented-out code --- src/Window.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/Window.cpp b/src/Window.cpp index eede1b7..186812f 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -118,30 +118,6 @@ 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()}; - SDL_DisplayMode dm; - SDL_GetCurrentDisplayMode(0, &dm); - if (dm.w < w || dm.h < h) { - double screen_ratio {static_cast(dm.w) / dm.h}; - double image_ratio {static_cast(w) / h}; - const int safety {100}; // room for window and desktop adornments - if (screen_ratio > image_ratio) { // screen relatively less high than image - h = dm.h - safety; - w = static_cast(round(image_ratio * h)); - } else { // screen relatively less wide than image - w = dm.w - safety; - h = static_cast(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) {