mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Add Horizontal and Vertical outline options in OutlineCommand
This commit is contained in:
parent
84b44a36ea
commit
61d1e7c46c
@ -1121,6 +1121,8 @@ color = Outline Color:
|
||||
outside = Outside
|
||||
inside = Inside
|
||||
circle = Circle
|
||||
horizontal = Horizontal
|
||||
vertical = Vertical
|
||||
square = Square
|
||||
bg_color = Background Color:
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
<vbox>
|
||||
<radio id="circle" text="@.circle" group="1" />
|
||||
<radio id="square" text="@.square" group="1" />
|
||||
<radio id="horizontal" text="@.horizontal" group="1" />
|
||||
<radio id="vertical" text="@.vertical" group="1" />
|
||||
</vbox>
|
||||
<vbox>
|
||||
<radio id="outside" text="@.outside" group="2" />
|
||||
|
@ -79,6 +79,8 @@ public:
|
||||
m_panel.inside()->setSelected(m_filter.place() == OutlineFilter::Place::Inside);
|
||||
m_panel.circle()->setSelected(m_filter.shape() == OutlineFilter::Shape::Circle);
|
||||
m_panel.square()->setSelected(m_filter.shape() == OutlineFilter::Shape::Square);
|
||||
m_panel.horizontal()->setSelected(m_filter.shape() == OutlineFilter::Shape::Horizontal);
|
||||
m_panel.vertical()->setSelected(m_filter.shape() == OutlineFilter::Shape::Vertical);
|
||||
|
||||
m_panel.color()->Change.connect(&OutlineWindow::onColorChange, this);
|
||||
m_panel.bgColor()->Change.connect(&OutlineWindow::onBgColorChange, this);
|
||||
@ -86,6 +88,8 @@ public:
|
||||
m_panel.inside()->Click.connect([this](ui::Event&){ onPlaceChange(OutlineFilter::Place::Inside); });
|
||||
m_panel.circle()->Click.connect([this](ui::Event&){ onShapeChange(OutlineFilter::Shape::Circle); });
|
||||
m_panel.square()->Click.connect([this](ui::Event&){ onShapeChange(OutlineFilter::Shape::Square); });
|
||||
m_panel.horizontal()->Click.connect([this](ui::Event&){ onShapeChange(OutlineFilter::Shape::Horizontal); });
|
||||
m_panel.vertical()->Click.connect([this](ui::Event&){ onShapeChange(OutlineFilter::Shape::Vertical); });
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -25,8 +25,11 @@ using namespace doc;
|
||||
|
||||
namespace {
|
||||
|
||||
static const int kCircleMatrix = 0272;
|
||||
static const int kSquareMatrix = 0777;
|
||||
static const int kMatrices[int(OutlineFilter::Shape::NShapes)] =
|
||||
{ 0272, // Circle
|
||||
0777, // Square
|
||||
0070, // Horizontal
|
||||
0202 }; // Vertical
|
||||
|
||||
struct GetPixelsDelegate {
|
||||
color_t bgColor;
|
||||
@ -37,8 +40,7 @@ namespace {
|
||||
|
||||
void init(color_t bgColor, OutlineFilter::Shape shape) {
|
||||
this->bgColor = bgColor;
|
||||
this->matrix = (shape == OutlineFilter::Shape::Circle ? kCircleMatrix:
|
||||
kSquareMatrix);
|
||||
this->matrix = kMatrices[int(shape)];
|
||||
}
|
||||
|
||||
void reset() {
|
||||
|
@ -17,7 +17,7 @@ namespace filters {
|
||||
class OutlineFilter : public Filter {
|
||||
public:
|
||||
enum class Place { Outside, Inside };
|
||||
enum class Shape { Circle, Square };
|
||||
enum class Shape { Circle, Square, Horizontal, Vertical, NShapes };
|
||||
|
||||
OutlineFilter();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user