diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-10 13:12:56 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-10 13:12:56 (GMT) |
| commit | a45ca0363e7598cb14d9dad00fae045e1487c2ed (patch) | |
| tree | 6786dd3bb81b8d676fa4c690123922ebd277cb55 /src/game/GameView.cpp | |
| parent | 810ea42f99cf9f56c1ac998ce8a203bea01e97b2 (diff) | |
| download | powder-a45ca0363e7598cb14d9dad00fae045e1487c2ed.zip powder-a45ca0363e7598cb14d9dad00fae045e1487c2ed.tar.gz | |
Tool - Correct box drawing. Finishing touches to tool strength (Fixes #87)
Diffstat (limited to 'src/game/GameView.cpp')
| -rw-r--r-- | src/game/GameView.cpp | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index 817887e..905b57b 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -1142,25 +1142,31 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool enableAltBehaviour(); break; case KEY_CTRL: - if(drawModeReset) - drawModeReset = false; - else - drawPoint1 = currentMouse; - if(shift) - drawMode = DrawFill; - else - drawMode = DrawRect; + if(!isMouseDown) + { + if(drawModeReset) + drawModeReset = false; + else + drawPoint1 = currentMouse; + if(shift) + drawMode = DrawFill; + else + drawMode = DrawRect; + } enableCtrlBehaviour(); break; case KEY_SHIFT: - if(drawModeReset) - drawModeReset = false; - else - drawPoint1 = currentMouse; - if(ctrl) - drawMode = DrawFill; - else - drawMode = DrawLine; + if(!isMouseDown) + { + if(drawModeReset) + drawModeReset = false; + else + drawPoint1 = currentMouse; + if(ctrl) + drawMode = DrawFill; + else + drawMode = DrawLine; + } enableShiftBehaviour(); break; case ' ': //Space @@ -1538,10 +1544,13 @@ void GameView::enableShiftBehaviour() if(!shiftBehaviour) { shiftBehaviour = true; - if(!ctrlBehaviour) - c->SetToolStrength(10.0f); - else - c->SetToolStrength(1.0f); + if(isMouseDown) + { + if(!ctrlBehaviour) + c->SetToolStrength(10.0f); + else + c->SetToolStrength(1.0f); + } } } @@ -1584,10 +1593,13 @@ void GameView::enableCtrlBehaviour() saveSimulationButton->Appearance.TextInactive = ui::Colour(0, 0, 0); searchButton->Appearance.BackgroundInactive = ui::Colour(255, 255, 255); searchButton->Appearance.TextInactive = ui::Colour(0, 0, 0); - if(!shiftBehaviour) - c->SetToolStrength(.1f); - else - c->SetToolStrength(1.0f); + if(isMouseDown) + { + if(!shiftBehaviour) + c->SetToolStrength(.1f); + else + c->SetToolStrength(1.0f); + } } } |
