Skip to content

Commit

Permalink
fix fullscreen-zoom hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
tizian committed Jan 8, 2022
1 parent 7b00ace commit ac66832
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void TonemapperGui::setImage(const std::string &filename) {

m_imageDisplayHeight = SCREEN_HEIGHT_DEFAULT;
m_imageDisplayWidth = SCREEN_HEIGHT_DEFAULT * int(m_image->getWidth() / m_image->getHeight());
m_screenSize = Vector2i(std::max(1280, m_imageDisplayWidth), m_imageDisplayHeight);
m_screenSize = Vector2i(std::max(int(SCREEN_WIDTH_DEFAULT), m_imageDisplayWidth), m_imageDisplayHeight);
set_size(Vector2i(m_screenSize));

m_imageDisplayScale = 0.f;
Expand Down Expand Up @@ -602,8 +602,8 @@ bool TonemapperGui::keyboard_event(int key, int scancode, int action, int modifi
if (fullscreen) {
float scale = std::pow(1.1f, m_imageDisplayScale);
Vector2f screenSize = Vector2f(m_screenSize),
imageSize = scale*Vector2f(float(m_image->getWidth()),
float(m_image->getHeight()));
imageSize = scale*Vector2f(float(m_imageDisplayWidth),
float(m_imageDisplayHeight));

Vector2f fullScale = screenSize / imageSize;
scale *= fullScale.x() < fullScale.y() ? fullScale.x() : fullScale.y();
Expand Down

0 comments on commit ac66832

Please sign in to comment.