diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-05 16:31:49 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-05 16:31:49 (GMT) |
| commit | d61690bc091af0e253abe18832cc06f6c998724a (patch) | |
| tree | bc152e2abb2790d03d9c24b9576954d307fbcafc /src/interface | |
| parent | d379390d066add46513da73a690ef20414b6627b (diff) | |
| download | powder-d61690bc091af0e253abe18832cc06f6c998724a.zip powder-d61690bc091af0e253abe18832cc06f6c998724a.tar.gz | |
Prevent setting double scale on smaller screens. Fixes #166
Diffstat (limited to 'src/interface')
| -rw-r--r-- | src/interface/DropDown.cpp | 2 | ||||
| -rw-r--r-- | src/interface/Engine.cpp | 8 | ||||
| -rw-r--r-- | src/interface/Engine.h | 7 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/interface/DropDown.cpp b/src/interface/DropDown.cpp index 7e8ee7f..0b05aac 100644 --- a/src/interface/DropDown.cpp +++ b/src/interface/DropDown.cpp @@ -88,7 +88,7 @@ DropDown::DropDown(Point position, Point size): void DropDown::OnMouseClick(int x, int y, unsigned int button) { DropDownWindow * newWindow = new DropDownWindow(this); - ui::Engine().Ref().ShowWindow(newWindow); + ui::Engine::Ref().ShowWindow(newWindow); } void DropDown::Draw(const Point& screenPos) diff --git a/src/interface/Engine.cpp b/src/interface/Engine.cpp index 1a8ad95..044b5e5 100644 --- a/src/interface/Engine.cpp +++ b/src/interface/Engine.cpp @@ -14,6 +14,8 @@ using namespace std; Engine::Engine(): state_(NULL), + maxWidth(0), + maxHeight(0), mousex_(0), mousey_(0), mousexp_(0), @@ -148,6 +150,12 @@ void Engine::SetSize(int width, int height) height_ = height; } +void Engine::SetMaxSize(int width, int height) +{ + maxWidth = width; + maxHeight = height; +} + void Engine::Tick() { if(state_ != NULL) diff --git a/src/interface/Engine.h b/src/interface/Engine.h index e9c4354..bcf10e6 100644 --- a/src/interface/Engine.h +++ b/src/interface/Engine.h @@ -57,6 +57,10 @@ namespace ui inline int GetMouseY() { return mousey_; } inline int GetWidth() { return width_; } inline int GetHeight() { return height_; } + inline int GetMaxWidth() { return maxWidth; } + inline int GetMaxHeight() { return maxHeight; } + + inline void SetMaxSize(int width, int height); inline void SetSize(int width, int height); @@ -90,6 +94,9 @@ namespace ui int mouseyp_; int width_; int height_; + + int maxWidth; + int maxHeight; }; } |
