From a989d977442674232a8512bb52ff06af1b93c58a Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 9 Feb 2013 00:01:00 -0500 Subject: [PATCH] flood fill / sample brush shape, fix rectangle snapping --- src/game/Brush.cpp | 5 ++++- src/game/GameView.cpp | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/game/Brush.cpp b/src/game/Brush.cpp index 38dd809a4..9f2f2a8bb 100644 --- a/src/game/Brush.cpp +++ b/src/game/Brush.cpp @@ -44,5 +44,8 @@ void Brush::RenderPoint(Renderer * ren, ui::Point position) void Brush::RenderFill(Renderer * ren, ui::Point position) { - + ren->xor_line(position.X-5, position.Y, position.X-1, position.Y); + ren->xor_line(position.X+5, position.Y, position.X+1, position.Y); + ren->xor_line(position.X, position.Y-5, position.X, position.Y-1); + ren->xor_line(position.X, position.Y+5, position.X, position.Y+1); } diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index 3e874e229..c8b46847c 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -997,7 +997,7 @@ void GameView::OnMouseMove(int x, int y, int dx, int dy) void GameView::OnMouseDown(int x, int y, unsigned button) { - if(altBehaviour && !shiftBehaviour) + if(altBehaviour && !shiftBehaviour && !ctrlBehaviour) button = BUTTON_MIDDLE; if(selectMode!=SelectNone) { @@ -1817,11 +1817,11 @@ void GameView::OnDraw() } activeBrush->RenderLine(ren, c->PointTranslate(initialDrawPoint), finalCurrentMouse); } - else if(drawMode==DrawFill) + else if(drawMode==DrawFill || altBehaviour) { activeBrush->RenderFill(ren, finalCurrentMouse); } - if (drawMode == DrawPoints || drawMode==DrawLine || (drawMode == DrawRect && !isMouseDown)) + if ((drawMode == DrawPoints || drawMode==DrawLine || (drawMode == DrawRect && !isMouseDown)) && !altBehaviour) { if(wallBrush) {