diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-14 11:15:28 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-14 11:15:28 (GMT) |
| commit | fe59ec9659a58bb91fd1d6c7babb26e5584f7cc3 (patch) | |
| tree | c941e47626f17445fec43278895c141626efc994 /src/interface | |
| parent | b05a847e967f5223b287e85f06b2be382b89fe19 (diff) | |
| download | powder-fe59ec9659a58bb91fd1d6c7babb26e5584f7cc3.zip powder-fe59ec9659a58bb91fd1d6c7babb26e5584f7cc3.tar.gz | |
Only call button actions if the mouse is released inside the button. Fixes #96
Diffstat (limited to 'src/interface')
| -rw-r--r-- | src/interface/Button.cpp | 3 | ||||
| -rw-r--r-- | src/interface/Button.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/interface/Button.cpp b/src/interface/Button.cpp index d5cc382..c6ebd79 100644 --- a/src/interface/Button.cpp +++ b/src/interface/Button.cpp @@ -142,7 +142,7 @@ void Button::Draw(const Point& screenPos) } } -void Button::OnMouseUp(int x, int y, unsigned int button) +void Button::OnMouseUnclick(int x, int y, unsigned int button) { if(button != 1) { @@ -183,6 +183,7 @@ void Button::OnMouseEnter(int x, int y) void Button::OnMouseLeave(int x, int y) { isMouseInside = false; + isButtonDown = false; } void Button::DoAction() diff --git a/src/interface/Button.h b/src/interface/Button.h index 2358d49..6b7fb96 100644 --- a/src/interface/Button.h +++ b/src/interface/Button.h @@ -34,7 +34,7 @@ public: bool Enabled; virtual void OnMouseClick(int x, int y, unsigned int button); - virtual void OnMouseUp(int x, int y, unsigned int button); + virtual void OnMouseUnclick(int x, int y, unsigned int button); //virtual void OnMouseUp(int x, int y, unsigned int button); virtual void OnMouseEnter(int x, int y); |
