- fixed: GUI mouse events did not take letterboxing into account.

SVN r2788 (trunk)
This commit is contained in:
Christoph Oelckers 2010-09-15 21:53:12 +00:00
parent 106cf82f62
commit c948fd08f2
4 changed files with 6 additions and 1 deletions

View File

@ -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;

View File

@ -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; }

View File

@ -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;

View File

@ -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;