From 3ebe02864072f99152749e85a3f20296d245e781 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Mon, 25 Jun 2018 22:53:10 +0200 Subject: [PATCH] Fix mouse pos when zoom=2 > fullscreen --- src/event.cxx | 7 +++---- src/event.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/event.cxx b/src/event.cxx index 9ca08b0..074dae5 100644 --- a/src/event.cxx +++ b/src/event.cxx @@ -1721,11 +1721,11 @@ CEvent::GetMousePos () // Initialise le mode full screen ou non. void -CEvent::SetFullScreen (bool bFullScreen) +CEvent::SetFullScreen (bool bFullScreen, double prevScale) { int x, y; SDL_GetMouseState (&x, &y); - this->m_pPixmap->FromDisplayToGame (x, y); + this->m_pPixmap->FromDisplayToGame (x, y, prevScale); g_bFullScreen = bFullScreen; @@ -4248,8 +4248,7 @@ CEvent::ChangeButtons (Sint32 message) { auto zoom = g_zoom; g_zoom = 1; - SetFullScreen (true); - SetWindowSize (zoom, 1); + SetFullScreen (true, zoom); break; } case EV_BUTTON4: diff --git a/src/event.h b/src/event.h index 2cd6db3..ce47479 100644 --- a/src/event.h +++ b/src/event.h @@ -98,7 +98,7 @@ public: Point GetMousePos (); void Create (CPixmap * pPixmap, CDecor * pDecor, CSound * pSound, CMovie * pMovie); - void SetFullScreen (bool bFullScreen); + void SetFullScreen (bool bFullScreen, double prevScale = 1); Sint32 GetWorld (); Sint32 GetPhysicalWorld (); Sint32 GetImageWorld ();