summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-09-05 17:44:53 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-09-05 17:44:53 (GMT)
commit09c266f25256d25103781e74038fc5265b957459 (patch)
tree185325347e2cb08653651ac95c9330b86a820bae /src
parent98725dea26857f9caac15ff88aff005dbba80530 (diff)
downloadpowder-09c266f25256d25103781e74038fc5265b957459.zip
powder-09c266f25256d25103781e74038fc5265b957459.tar.gz
Perform pointtranslate (zoom) only in GameView. Fixes point line issue in #175
Diffstat (limited to 'src')
-rw-r--r--src/game/GameController.cpp10
-rw-r--r--src/game/GameView.cpp22
2 files changed, 16 insertions, 16 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 860c23a..fd64654 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -374,7 +374,7 @@ void GameController::DrawRect(int toolSelection, ui::Point point1, ui::Point poi
if(!activeTool || !cBrush)
return;
activeTool->SetStrength(gameModel->GetToolStrength());
- activeTool->DrawRect(sim, cBrush, PointTranslate(point1), PointTranslate(point2));
+ activeTool->DrawRect(sim, cBrush, point1, point2);
}
void GameController::DrawLine(int toolSelection, ui::Point point1, ui::Point point2)
@@ -386,7 +386,7 @@ void GameController::DrawLine(int toolSelection, ui::Point point1, ui::Point poi
if(!activeTool || !cBrush)
return;
activeTool->SetStrength(gameModel->GetToolStrength());
- activeTool->DrawLine(sim, cBrush, PointTranslate(point1), PointTranslate(point2));
+ activeTool->DrawLine(sim, cBrush, point1, point2);
}
void GameController::DrawFill(int toolSelection, ui::Point point)
@@ -398,7 +398,7 @@ void GameController::DrawFill(int toolSelection, ui::Point point)
if(!activeTool || !cBrush)
return;
activeTool->SetStrength(gameModel->GetToolStrength());
- activeTool->DrawFill(sim, cBrush, PointTranslate(point));
+ activeTool->DrawFill(sim, cBrush, point);
}
void GameController::DrawPoints(int toolSelection, queue<ui::Point*> & pointQueue)
@@ -427,7 +427,7 @@ void GameController::DrawPoints(int toolSelection, queue<ui::Point*> & pointQueu
bool first = true;
while(!pointQueue.empty())
{
- ui::Point fPoint = PointTranslate(*pointQueue.front());
+ ui::Point fPoint = *pointQueue.front();
delete pointQueue.front();
pointQueue.pop();
if(!first)
@@ -480,7 +480,7 @@ void GameController::ToolClick(int toolSelection, ui::Point point)
Brush * cBrush = gameModel->GetBrush();
if(!activeTool || !cBrush)
return;
- activeTool->Click(sim, cBrush, PointTranslate(point));
+ activeTool->Click(sim, cBrush, point);
}
void GameController::StampRegion(ui::Point point1, ui::Point point2)
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index 3955c67..a05e7ef 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -981,8 +981,8 @@ void GameView::OnMouseMove(int x, int y, int dx, int dy)
currentMouse = ui::Point(x, y);
if(isMouseDown && drawMode == DrawPoints)
{
- pointQueue.push(new ui::Point(x-dx, y-dy));
- pointQueue.push(new ui::Point(x, y));
+ pointQueue.push(new ui::Point(c->PointTranslate(ui::Point(x-dx, y-dy))));
+ pointQueue.push(new ui::Point(c->PointTranslate(ui::Point(x, y))));
}
}
@@ -1014,7 +1014,7 @@ void GameView::OnMouseDown(int x, int y, unsigned button)
}
if(drawMode == DrawPoints)
{
- pointQueue.push(new ui::Point(x, y));
+ pointQueue.push(new ui::Point(c->PointTranslate(ui::Point(x, y))));
}
}
}
@@ -1082,26 +1082,26 @@ void GameView::OnMouseUp(int x, int y, unsigned button)
if(drawSnap && drawMode == DrawLine)
{
- finalDrawPoint2 = lineSnapCoords(drawPoint1, drawPoint2);
+ finalDrawPoint2 = c->PointTranslate(lineSnapCoords(c->PointTranslate(drawPoint1), drawPoint2));
}
if(drawSnap && drawMode == DrawRect)
{
- finalDrawPoint2 = rectSnapCoords(drawPoint1, drawPoint2);
+ finalDrawPoint2 = c->PointTranslate(rectSnapCoords(c->PointTranslate(drawPoint1), drawPoint2));
}
if(drawMode == DrawRect)
{
- c->DrawRect(toolIndex, drawPoint1, finalDrawPoint2);
+ c->DrawRect(toolIndex, c->PointTranslate(drawPoint1), finalDrawPoint2);
}
if(drawMode == DrawLine)
{
- c->DrawLine(toolIndex, drawPoint1, finalDrawPoint2);
+ c->DrawLine(toolIndex, c->PointTranslate(drawPoint1), finalDrawPoint2);
}
}
if(drawMode == DrawPoints)
{
- c->ToolClick(toolIndex, ui::Point(x, y));
+ c->ToolClick(toolIndex, c->PointTranslate(ui::Point(x, y)));
//pointQueue.push(new ui::Point(x, y));
}
if(drawModeReset)
@@ -1169,7 +1169,7 @@ void GameView::OnMouseWheel(int x, int y, int d)
c->AdjustBrushSize(d, false, shiftBehaviour, ctrlBehaviour);
if(isMouseDown)
{
- pointQueue.push(new ui::Point(x, y));
+ pointQueue.push(new ui::Point(c->PointTranslate(ui::Point(x, y))));
}
}
}
@@ -1453,7 +1453,7 @@ void GameView::OnTick(float dt)
{
if(isMouseDown)
{
- pointQueue.push(new ui::Point(currentMouse));
+ pointQueue.push(new ui::Point(c->PointTranslate(currentMouse)));
}
if(!pointQueue.empty())
{
@@ -1462,7 +1462,7 @@ void GameView::OnTick(float dt)
}
if(drawMode == DrawFill && isMouseDown)
{
- c->DrawFill(toolIndex, currentMouse);
+ c->DrawFill(toolIndex, c->PointTranslate(currentMouse));
}
if(introText)
{