mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-10 10:13:35 +00:00
Don't use brush edges on tools with "one pixel" point shape (fix #1167)
This commit is contained in:
parent
b094f6e557
commit
9748894a26
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -19,6 +19,7 @@ namespace app {
|
||||
class PointShape {
|
||||
public:
|
||||
virtual ~PointShape() { }
|
||||
virtual bool isPixel() { return false; }
|
||||
virtual bool isFloodFill() { return false; }
|
||||
virtual bool isSpray() { return false; }
|
||||
virtual void preparePointShape(ToolLoop* loop) { }
|
||||
|
@ -21,6 +21,8 @@ public:
|
||||
|
||||
class PixelPointShape : public PointShape {
|
||||
public:
|
||||
bool isPixel() override { return true; }
|
||||
|
||||
void transformPoint(ToolLoop* loop, int x, int y) override {
|
||||
doInkHline(x, y, x, loop);
|
||||
}
|
||||
|
@ -305,17 +305,19 @@ void BrushPreview::generateBoundaries()
|
||||
m_brushGen == brush->gen())
|
||||
return;
|
||||
|
||||
bool isFloodfill = m_editor->getCurrentEditorTool()->getPointShape(0)->isFloodFill();
|
||||
bool isOnePixel =
|
||||
(m_editor->getCurrentEditorTool()->getPointShape(0)->isPixel() ||
|
||||
m_editor->getCurrentEditorTool()->getPointShape(0)->isFloodFill());
|
||||
Image* brushImage = brush->image();
|
||||
int w = (isFloodfill ? 1: brushImage->width());
|
||||
int h = (isFloodfill ? 1: brushImage->height());
|
||||
int w = (isOnePixel ? 1: brushImage->width());
|
||||
int h = (isOnePixel ? 1: brushImage->height());
|
||||
|
||||
m_brushGen = brush->gen();
|
||||
m_brushWidth = w;
|
||||
m_brushHeight = h;
|
||||
|
||||
ImageRef mask;
|
||||
if (isFloodfill) {
|
||||
if (isOnePixel) {
|
||||
mask.reset(Image::create(IMAGE_BITMAP, w, w));
|
||||
mask->putPixel(0, 0, (color_t)1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user