Faster brush adjusting with [ and ], use alt to change to 1 pixel
This commit is contained in:
parent
9c67d41ad6
commit
6d5388b221
@ -193,7 +193,7 @@ void GameController::AdjustBrushSize(int direction, bool logarithmic, bool xAxis
|
|||||||
ui::Point newSize(0, 0);
|
ui::Point newSize(0, 0);
|
||||||
ui::Point oldSize = gameModel->GetBrush()->GetRadius();
|
ui::Point oldSize = gameModel->GetBrush()->GetRadius();
|
||||||
if(logarithmic)
|
if(logarithmic)
|
||||||
newSize = gameModel->GetBrush()->GetRadius() + ui::Point(direction * ((gameModel->GetBrush()->GetRadius().X/10)>0?gameModel->GetBrush()->GetRadius().X/10:1), direction * ((gameModel->GetBrush()->GetRadius().Y/10)>0?gameModel->GetBrush()->GetRadius().Y/10:1));
|
newSize = gameModel->GetBrush()->GetRadius() + ui::Point(direction * ((gameModel->GetBrush()->GetRadius().X/5)>0?gameModel->GetBrush()->GetRadius().X/5:1), direction * ((gameModel->GetBrush()->GetRadius().Y/5)>0?gameModel->GetBrush()->GetRadius().Y/5:1));
|
||||||
else
|
else
|
||||||
newSize = gameModel->GetBrush()->GetRadius() + ui::Point(direction, direction);
|
newSize = gameModel->GetBrush()->GetRadius() + ui::Point(direction, direction);
|
||||||
if(newSize.X<0)
|
if(newSize.X<0)
|
||||||
|
@ -909,6 +909,7 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
{
|
{
|
||||||
case KEY_ALT:
|
case KEY_ALT:
|
||||||
drawSnap = true;
|
drawSnap = true;
|
||||||
|
enableAltBehaviour();
|
||||||
break;
|
break;
|
||||||
case KEY_CTRL:
|
case KEY_CTRL:
|
||||||
if(drawModeReset)
|
if(drawModeReset)
|
||||||
@ -989,10 +990,10 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
c->OpenStamps();
|
c->OpenStamps();
|
||||||
break;
|
break;
|
||||||
case ']':
|
case ']':
|
||||||
c->AdjustBrushSize(1, true, shiftBehaviour, ctrlBehaviour);
|
c->AdjustBrushSize(1, !alt, shiftBehaviour, ctrlBehaviour);
|
||||||
break;
|
break;
|
||||||
case '[':
|
case '[':
|
||||||
c->AdjustBrushSize(-1, true, shiftBehaviour, ctrlBehaviour);
|
c->AdjustBrushSize(-1, !alt, shiftBehaviour, ctrlBehaviour);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1019,6 +1020,7 @@ void GameView::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bo
|
|||||||
{
|
{
|
||||||
case KEY_ALT:
|
case KEY_ALT:
|
||||||
drawSnap = false;
|
drawSnap = false;
|
||||||
|
disableAltBehaviour();
|
||||||
break;
|
break;
|
||||||
case KEY_CTRL:
|
case KEY_CTRL:
|
||||||
disableCtrlBehaviour();
|
disableCtrlBehaviour();
|
||||||
@ -1264,6 +1266,22 @@ void GameView::disableShiftBehaviour()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameView::enableAltBehaviour()
|
||||||
|
{
|
||||||
|
if(!altBehaviour)
|
||||||
|
{
|
||||||
|
altBehaviour = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameView::disableAltBehaviour()
|
||||||
|
{
|
||||||
|
if(altBehaviour)
|
||||||
|
{
|
||||||
|
altBehaviour = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GameView::enableCtrlBehaviour()
|
void GameView::enableCtrlBehaviour()
|
||||||
{
|
{
|
||||||
if(!ctrlBehaviour)
|
if(!ctrlBehaviour)
|
||||||
|
@ -40,6 +40,7 @@ private:
|
|||||||
bool drawSnap;
|
bool drawSnap;
|
||||||
bool shiftBehaviour;
|
bool shiftBehaviour;
|
||||||
bool ctrlBehaviour;
|
bool ctrlBehaviour;
|
||||||
|
bool altBehaviour;
|
||||||
bool showHud;
|
bool showHud;
|
||||||
int toolIndex;
|
int toolIndex;
|
||||||
|
|
||||||
@ -109,6 +110,8 @@ private:
|
|||||||
void disableShiftBehaviour();
|
void disableShiftBehaviour();
|
||||||
void enableCtrlBehaviour();
|
void enableCtrlBehaviour();
|
||||||
void disableCtrlBehaviour();
|
void disableCtrlBehaviour();
|
||||||
|
void enableAltBehaviour();
|
||||||
|
void disableAltBehaviour();
|
||||||
public:
|
public:
|
||||||
GameView();
|
GameView();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user