Fix WIND tool not reacting to zoom window properly, fixes #899

This commit is contained in:
jacob1 2023-01-23 20:32:27 -05:00
parent 8ce7a37070
commit e824e023f1
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995
3 changed files with 8 additions and 2 deletions

View File

@ -371,6 +371,11 @@ ui::Point GameController::PointTranslate(ui::Point point)
return gameModel->AdjustZoomCoords(point);
}
ui::Point GameController::PointTranslateNoClamp(ui::Point point)
{
return gameModel->AdjustZoomCoords(point);
}
ui::Point GameController::NormaliseBlockCoord(ui::Point point)
{
return (point/CELL)*CELL;

View File

@ -164,6 +164,7 @@ public:
void TransformSave(matrix2d transform);
bool MouseInZoom(ui::Point position);
ui::Point PointTranslate(ui::Point point);
ui::Point PointTranslateNoClamp(ui::Point point);
ui::Point NormaliseBlockCoord(ui::Point point);
String ElementResolve(int type, int ctype);
String BasicParticleInfo(Particle const &sample_part);

View File

@ -1697,7 +1697,7 @@ void GameView::OnTick(float dt)
ui::Point drawPoint2 = currentMouse;
if (altBehaviour)
drawPoint2 = lineSnapCoords(c->PointTranslate(drawPoint1), currentMouse);
c->DrawLine(toolIndex, c->PointTranslate(drawPoint1), drawPoint2);
c->DrawLine(toolIndex, c->PointTranslate(drawPoint1), c->PointTranslateNoClamp(drawPoint2));
}
}
@ -2079,7 +2079,7 @@ void GameView::OnDraw()
ren->SetSample(c->PointTranslate(currentMouse).X, c->PointTranslate(currentMouse).Y);
if (showBrush && selectMode == SelectNone && (!zoomEnabled || zoomCursorFixed) && activeBrush && (isMouseDown || (currentMouse.X >= 0 && currentMouse.X < XRES && currentMouse.Y >= 0 && currentMouse.Y < YRES)))
{
ui::Point finalCurrentMouse = c->PointTranslate(currentMouse);
ui::Point finalCurrentMouse = windTool ? c->PointTranslateNoClamp(currentMouse) : c->PointTranslate(currentMouse);
ui::Point initialDrawPoint = drawPoint1;
if (wallBrush)