[aseprite] 30/51: Don't use brush edges on tools with "one pixel" point shape (fix #1167)
Tobias Hansen
thansen at moszumanska.debian.org
Mon Jul 11 21:35:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 9748894a2675204072190691453053b04454c086
Author: David Capello <davidcapello at gmail.com>
Date: Fri Jul 1 12:55:29 2016 -0300
Don't use brush edges on tools with "one pixel" point shape (fix #1167)
---
src/app/tools/point_shape.h | 3 ++-
src/app/tools/point_shapes.h | 2 ++
src/app/ui/editor/brush_preview.cpp | 10 ++++++----
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/app/tools/point_shape.h b/src/app/tools/point_shape.h
index 6f2034c..052a020 100644
--- a/src/app/tools/point_shape.h
+++ b/src/app/tools/point_shape.h
@@ -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) { }
diff --git a/src/app/tools/point_shapes.h b/src/app/tools/point_shapes.h
index 6398cec..f340b83 100644
--- a/src/app/tools/point_shapes.h
+++ b/src/app/tools/point_shapes.h
@@ -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);
}
diff --git a/src/app/ui/editor/brush_preview.cpp b/src/app/ui/editor/brush_preview.cpp
index 02b6955..598fe1d 100644
--- a/src/app/ui/editor/brush_preview.cpp
+++ b/src/app/ui/editor/brush_preview.cpp
@@ -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);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list