flood fill / sample brush shape, fix rectangle snapping

This commit is contained in:
jacob1 2013-02-09 00:01:00 -05:00
parent 685bde5c21
commit a989d97744
2 changed files with 7 additions and 4 deletions

View File

@ -44,5 +44,8 @@ void Brush::RenderPoint(Renderer * ren, ui::Point position)
void Brush::RenderFill(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);
} }

View File

@ -997,7 +997,7 @@ void GameView::OnMouseMove(int x, int y, int dx, int dy)
void GameView::OnMouseDown(int x, int y, unsigned button) void GameView::OnMouseDown(int x, int y, unsigned button)
{ {
if(altBehaviour && !shiftBehaviour) if(altBehaviour && !shiftBehaviour && !ctrlBehaviour)
button = BUTTON_MIDDLE; button = BUTTON_MIDDLE;
if(selectMode!=SelectNone) if(selectMode!=SelectNone)
{ {
@ -1817,11 +1817,11 @@ void GameView::OnDraw()
} }
activeBrush->RenderLine(ren, c->PointTranslate(initialDrawPoint), finalCurrentMouse); activeBrush->RenderLine(ren, c->PointTranslate(initialDrawPoint), finalCurrentMouse);
} }
else if(drawMode==DrawFill) else if(drawMode==DrawFill || altBehaviour)
{ {
activeBrush->RenderFill(ren, finalCurrentMouse); activeBrush->RenderFill(ren, finalCurrentMouse);
} }
if (drawMode == DrawPoints || drawMode==DrawLine || (drawMode == DrawRect && !isMouseDown)) if ((drawMode == DrawPoints || drawMode==DrawLine || (drawMode == DrawRect && !isMouseDown)) && !altBehaviour)
{ {
if(wallBrush) if(wallBrush)
{ {