ability to use zoom tool while placing stamps

This commit is contained in:
jacob1 2013-07-18 16:01:32 -04:00
parent f56a2f6000
commit fe78593ca2

View File

@ -1022,6 +1022,7 @@ void GameView::setToolButtonOffset(int offset)
void GameView::OnMouseMove(int x, int y, int dx, int dy)
{
mousePosition = c->PointTranslate(ui::Point(x, y));
currentMouse = ui::Point(x, y);
if(selectMode!=SelectNone)
{
if(selectMode==PlaceSave)
@ -1030,7 +1031,6 @@ void GameView::OnMouseMove(int x, int y, int dx, int dy)
selectPoint2 = c->PointTranslate(ui::Point(x, y));
return;
}
currentMouse = ui::Point(x, y);
if(isMouseDown && drawMode == DrawPoints)
{
pointQueue.push(ui::Point(c->PointTranslate(ui::Point(x-dx, y-dy))));
@ -1075,6 +1075,10 @@ void GameView::OnMouseDown(int x, int y, unsigned button)
void GameView::OnMouseUp(int x, int y, unsigned button)
{
if(zoomEnabled && !zoomCursorFixed)
zoomCursorFixed = true;
else
{
if(selectMode!=SelectNone)
{
if(button==BUTTON_LEFT)
@ -1113,15 +1117,10 @@ void GameView::OnMouseUp(int x, int y, unsigned button)
c->StampRegion(ui::Point(x1, y1), ui::Point(x2, y2));
}
}
currentMouse = ui::Point(x, y);
selectMode = SelectNone;
return;
}
if(zoomEnabled && !zoomCursorFixed)
zoomCursorFixed = true;
else
{
if(isMouseDown)
{
isMouseDown = false;
@ -1274,7 +1273,7 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
break;
}
}
if(key != ' ')
if(key != ' ' && key != 'z')
return;
}
switch(key)
@ -1470,12 +1469,11 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
else
c->InvertAirSim();
break;
}
if (key == SDLK_INSERT)
case SDLK_INSERT:
c->SetReplaceModeFlags(c->GetReplaceModeFlags()^REPLACE_MODE);
else if (key == SDLK_DELETE)
case SDLK_DELETE:
c->SetReplaceModeFlags(c->GetReplaceModeFlags()^SPECIFIC_DELETE);
}
if (shift && showDebug && key == '1')
c->LoadRenderPreset(10);