mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
- fixed: GUI mouse events did not take letterboxing into account.
SVN r2788 (trunk)
This commit is contained in:
parent
106cf82f62
commit
c948fd08f2
4 changed files with 6 additions and 1 deletions
|
@ -211,7 +211,8 @@ bool DMenu::MouseEventBack(int type, int x, int y)
|
|||
{
|
||||
if (m_show_backbutton&1) x -= screen->GetWidth() - tex->GetScaledWidth() * CleanXfac;
|
||||
if (m_show_backbutton&2) y -= screen->GetHeight() - tex->GetScaledHeight() * CleanYfac;
|
||||
mBackbuttonSelected = (x >= 0 && x < tex->GetScaledWidth() * CleanXfac && y < tex->GetScaledHeight() * CleanYfac);
|
||||
mBackbuttonSelected = ( x >= 0 && x < tex->GetScaledWidth() * CleanXfac &&
|
||||
y >= 0 && y < tex->GetScaledHeight() * CleanYfac);
|
||||
if (mBackbuttonSelected && type == MOUSE_Release)
|
||||
{
|
||||
if (m_use_mouse == 2) mBackbuttonSelected = false;
|
||||
|
|
|
@ -413,6 +413,7 @@ public:
|
|||
virtual bool WipeDo(int ticks);
|
||||
virtual void WipeCleanup();
|
||||
virtual int GetPixelDoubling() const { return 0; }
|
||||
virtual int GetTrueHeight() { return GetHeight(); }
|
||||
|
||||
uint32 GetLastFPS() const { return LastCount; }
|
||||
|
||||
|
|
|
@ -325,6 +325,7 @@ bool GUIWndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESU
|
|||
int shift = screen? screen->GetPixelDoubling() : 0;
|
||||
ev.data1 = LOWORD(lParam) >> shift;
|
||||
ev.data2 = HIWORD(lParam) >> shift;
|
||||
if (screen) ev.data2 -= (screen->GetTrueHeight() - screen->GetHeight())/2;
|
||||
}
|
||||
|
||||
if (wParam & MK_SHIFT) ev.data3 |= GKM_SHIFT;
|
||||
|
|
|
@ -162,6 +162,7 @@ public:
|
|||
void SetVSync (bool vsync);
|
||||
void NewRefreshRate();
|
||||
HRESULT GetHR ();
|
||||
virtual int GetTrueHeight() { return TrueHeight; }
|
||||
|
||||
void Blank ();
|
||||
bool PaintToWindow ();
|
||||
|
@ -265,6 +266,7 @@ public:
|
|||
bool WipeDo(int ticks);
|
||||
void WipeCleanup();
|
||||
HRESULT GetHR ();
|
||||
virtual int GetTrueHeight() { return TrueHeight; }
|
||||
|
||||
private:
|
||||
friend class D3DTex;
|
||||
|
|
Loading…
Reference in a new issue