Change zoom size with [ and ], fixes #90

This commit is contained in:
Simon Robertshaw
2012-08-10 22:09:04 +01:00
parent c1d7de24f2
commit 92311a38c0
2 changed files with 10 additions and 4 deletions

View File

@@ -264,9 +264,9 @@ void GameController::AdjustZoomSize(int direction, bool logarithmic)
{ {
int newSize; int newSize;
if(logarithmic) if(logarithmic)
newSize = gameModel->GetZoomSize()+direction;
else
newSize = gameModel->GetZoomSize()+(((gameModel->GetZoomSize()/10)>0?(gameModel->GetZoomSize()/10):1)*direction); newSize = gameModel->GetZoomSize()+(((gameModel->GetZoomSize()/10)>0?(gameModel->GetZoomSize()/10):1)*direction);
else
newSize = gameModel->GetZoomSize()+direction;
if(newSize<5) if(newSize<5)
newSize = 5; newSize = 5;
if(newSize>64) if(newSize>64)

View File

@@ -1275,10 +1275,16 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
c->OpenStamps(); c->OpenStamps();
break; break;
case ']': case ']':
c->AdjustBrushSize(1, !alt, shiftBehaviour, ctrlBehaviour); if(zoomEnabled && !zoomCursorFixed)
c->AdjustZoomSize(1, !alt);
else
c->AdjustBrushSize(1, !alt, shiftBehaviour, ctrlBehaviour);
break; break;
case '[': case '[':
c->AdjustBrushSize(-1, !alt, shiftBehaviour, ctrlBehaviour); if(zoomEnabled && !zoomCursorFixed)
c->AdjustZoomSize(-1, !alt);
else
c->AdjustBrushSize(-1, !alt, shiftBehaviour, ctrlBehaviour);
break; break;
case 'i': case 'i':
if(ctrl) if(ctrl)