mirror of https://github.com/aseprite/aseprite.git
Merge 0f32b43475
into 6d89a6bc15
This commit is contained in:
commit
f9cf6b9f64
Binary file not shown.
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
@ -256,12 +256,12 @@
|
||||||
<part id="pal_presets" x="160" y="200" w="5" h="5" />
|
<part id="pal_presets" x="160" y="200" w="5" h="5" />
|
||||||
<part id="pal_options" x="168" y="200" w="5" h="5" />
|
<part id="pal_options" x="168" y="200" w="5" h="5" />
|
||||||
<part id="pal_resize" x="176" y="200" w="5" h="5" />
|
<part id="pal_resize" x="176" y="200" w="5" h="5" />
|
||||||
<part id="debug_continue" x="208" y="240" w="7" h="7" />
|
<part id="debug_continue" x="224" y="240" w="7" h="7" />
|
||||||
<part id="debug_pause" x="208" y="247" w="7" h="7" />
|
<part id="debug_pause" x="224" y="247" w="7" h="7" />
|
||||||
<part id="debug_step_into" x="222" y="240" w="7" h="7" />
|
<part id="debug_step_into" x="238" y="240" w="7" h="7" />
|
||||||
<part id="debug_step_over" x="215" y="240" w="7" h="7" />
|
<part id="debug_step_over" x="231" y="240" w="7" h="7" />
|
||||||
<part id="debug_step_out" x="229" y="240" w="7" h="7" />
|
<part id="debug_step_out" x="245" y="240" w="7" h="7" />
|
||||||
<part id="debug_breakpoint" x="236" y="240" w="7" h="7" />
|
<part id="debug_breakpoint" x="252" y="240" w="7" h="7" />
|
||||||
<part id="selection_replace" x="176" y="160" w="7" h="7" />
|
<part id="selection_replace" x="176" y="160" w="7" h="7" />
|
||||||
<part id="selection_add" x="184" y="160" w="7" h="7" />
|
<part id="selection_add" x="184" y="160" w="7" h="7" />
|
||||||
<part id="selection_subtract" x="192" y="160" w="7" h="7" />
|
<part id="selection_subtract" x="192" y="160" w="7" h="7" />
|
||||||
|
@ -456,6 +456,7 @@
|
||||||
<part id="spin_down" x="128" y="259" w="5" h="3" />
|
<part id="spin_down" x="128" y="259" w="5" h="3" />
|
||||||
<part id="right_diagonal_symmetry" x="176" y="240" w="13" h="13" />
|
<part id="right_diagonal_symmetry" x="176" y="240" w="13" h="13" />
|
||||||
<part id="left_diagonal_symmetry" x="192" y="240" w="13" h="13" />
|
<part id="left_diagonal_symmetry" x="192" y="240" w="13" h="13" />
|
||||||
|
<part id="point_symmetry" x="208" y="240" w="13" h="13" />
|
||||||
</parts>
|
</parts>
|
||||||
<styles>
|
<styles>
|
||||||
<style id="box" />
|
<style id="box" />
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
@ -252,12 +252,12 @@
|
||||||
<part id="pal_presets" x="160" y="200" w="5" h="5" />
|
<part id="pal_presets" x="160" y="200" w="5" h="5" />
|
||||||
<part id="pal_options" x="168" y="200" w="5" h="5" />
|
<part id="pal_options" x="168" y="200" w="5" h="5" />
|
||||||
<part id="pal_resize" x="176" y="200" w="5" h="5" />
|
<part id="pal_resize" x="176" y="200" w="5" h="5" />
|
||||||
<part id="debug_continue" x="208" y="240" w="7" h="7" />
|
<part id="debug_continue" x="224" y="240" w="7" h="7" />
|
||||||
<part id="debug_pause" x="208" y="247" w="7" h="7" />
|
<part id="debug_pause" x="224" y="247" w="7" h="7" />
|
||||||
<part id="debug_step_into" x="222" y="240" w="7" h="7" />
|
<part id="debug_step_into" x="238" y="240" w="7" h="7" />
|
||||||
<part id="debug_step_over" x="215" y="240" w="7" h="7" />
|
<part id="debug_step_over" x="231" y="240" w="7" h="7" />
|
||||||
<part id="debug_step_out" x="229" y="240" w="7" h="7" />
|
<part id="debug_step_out" x="245" y="240" w="7" h="7" />
|
||||||
<part id="debug_breakpoint" x="236" y="240" w="7" h="7" />
|
<part id="debug_breakpoint" x="252" y="240" w="7" h="7" />
|
||||||
<part id="selection_replace" x="176" y="160" w="7" h="7" />
|
<part id="selection_replace" x="176" y="160" w="7" h="7" />
|
||||||
<part id="selection_add" x="184" y="160" w="7" h="7" />
|
<part id="selection_add" x="184" y="160" w="7" h="7" />
|
||||||
<part id="selection_subtract" x="192" y="160" w="7" h="7" />
|
<part id="selection_subtract" x="192" y="160" w="7" h="7" />
|
||||||
|
@ -452,6 +452,7 @@
|
||||||
<part id="spin_down" x="128" y="259" w="5" h="3" />
|
<part id="spin_down" x="128" y="259" w="5" h="3" />
|
||||||
<part id="right_diagonal_symmetry" x="176" y="240" w="13" h="13" />
|
<part id="right_diagonal_symmetry" x="176" y="240" w="13" h="13" />
|
||||||
<part id="left_diagonal_symmetry" x="192" y="240" w="13" h="13" />
|
<part id="left_diagonal_symmetry" x="192" y="240" w="13" h="13" />
|
||||||
|
<part id="point_symmetry" x="208" y="240" w="13" h="13" />
|
||||||
</parts>
|
</parts>
|
||||||
<styles>
|
<styles>
|
||||||
<style id="box" />
|
<style id="box" />
|
||||||
|
|
|
@ -554,6 +554,9 @@
|
||||||
<key command="SymmetryMode">
|
<key command="SymmetryMode">
|
||||||
<param name="orientation" value="left_diagonal" />
|
<param name="orientation" value="left_diagonal" />
|
||||||
</key>
|
</key>
|
||||||
|
<key command="SymmetryMode">
|
||||||
|
<param name="orientation" value="point" />
|
||||||
|
</key>
|
||||||
<key command="AutocropSprite" />
|
<key command="AutocropSprite" />
|
||||||
<key command="AutocropSprite">
|
<key command="AutocropSprite">
|
||||||
<param name="byGrid" value="true" />
|
<param name="byGrid" value="true" />
|
||||||
|
|
|
@ -97,6 +97,7 @@
|
||||||
<value id="RIGHT_DIAG" value="4" />
|
<value id="RIGHT_DIAG" value="4" />
|
||||||
<value id="LEFT_DIAG" value="8" />
|
<value id="LEFT_DIAG" value="8" />
|
||||||
<value id="BOTH_DIAG" value="12" />
|
<value id="BOTH_DIAG" value="12" />
|
||||||
|
<value id="POINT" value="16" />
|
||||||
<value id="ALL" value="15" />
|
<value id="ALL" value="15" />
|
||||||
</enum>
|
</enum>
|
||||||
<enum id="PaintingCursorType">
|
<enum id="PaintingCursorType">
|
||||||
|
|
|
@ -1944,6 +1944,7 @@ toggle_horizontal = Toggle Horizontal Symmetry
|
||||||
toggle_vertical = Toggle Vertical Symmetry
|
toggle_vertical = Toggle Vertical Symmetry
|
||||||
toggle_right_diagonal = Toggle 45° Symmetry
|
toggle_right_diagonal = Toggle 45° Symmetry
|
||||||
toggle_left_diagonal = Toggle -45° Symmetry
|
toggle_left_diagonal = Toggle -45° Symmetry
|
||||||
|
toggle_point = Toggle Point Symmetry
|
||||||
show_options = Symmetry Options
|
show_options = Symmetry Options
|
||||||
reset_position = Reset Symmetry to Center
|
reset_position = Reset Symmetry to Center
|
||||||
reset_position_to_view_center = Reset Symmetry to View Center
|
reset_position_to_view_center = Reset Symmetry to View Center
|
||||||
|
|
|
@ -48,6 +48,7 @@ std::string SymmetryModeCommand::onGetFriendlyName() const
|
||||||
case app::gen::SymmetryMode::VERTICAL: return Strings::symmetry_toggle_vertical();
|
case app::gen::SymmetryMode::VERTICAL: return Strings::symmetry_toggle_vertical();
|
||||||
case app::gen::SymmetryMode::RIGHT_DIAG: return Strings::symmetry_toggle_right_diagonal();
|
case app::gen::SymmetryMode::RIGHT_DIAG: return Strings::symmetry_toggle_right_diagonal();
|
||||||
case app::gen::SymmetryMode::LEFT_DIAG: return Strings::symmetry_toggle_left_diagonal();
|
case app::gen::SymmetryMode::LEFT_DIAG: return Strings::symmetry_toggle_left_diagonal();
|
||||||
|
case app::gen::SymmetryMode::POINT: return Strings::symmetry_toggle_point();
|
||||||
default: return Strings::symmetry_toggle();
|
default: return Strings::symmetry_toggle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +64,8 @@ void SymmetryModeCommand::onLoadParams(const Params& params)
|
||||||
m_mode = app::gen::SymmetryMode::RIGHT_DIAG;
|
m_mode = app::gen::SymmetryMode::RIGHT_DIAG;
|
||||||
else if (mode == "left_diagonal")
|
else if (mode == "left_diagonal")
|
||||||
m_mode = app::gen::SymmetryMode::LEFT_DIAG;
|
m_mode = app::gen::SymmetryMode::LEFT_DIAG;
|
||||||
|
else if (mode == "point")
|
||||||
|
m_mode = app::gen::SymmetryMode::POINT;
|
||||||
else
|
else
|
||||||
m_mode = app::gen::SymmetryMode::NONE;
|
m_mode = app::gen::SymmetryMode::NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,15 @@ void Symmetry::generateStrokes(const Stroke& stroke, Strokes& strokes, ToolLoop*
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case gen::SymmetryMode::POINT: {
|
||||||
|
Stroke strokeTemp;
|
||||||
|
calculateSymmetricalStroke(stroke, strokeTemp, loop, doc::SymmetryIndex::FLIPPED_Y);
|
||||||
|
|
||||||
|
calculateSymmetricalStroke(strokeTemp, stroke2, loop, doc::SymmetryIndex::FLIPPED_XY);
|
||||||
|
strokes.push_back(stroke2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case gen::SymmetryMode::ALL: {
|
case gen::SymmetryMode::ALL: {
|
||||||
calculateSymmetricalStroke(stroke, stroke2, loop, doc::SymmetryIndex::FLIPPED_X);
|
calculateSymmetricalStroke(stroke, stroke2, loop, doc::SymmetryIndex::FLIPPED_X);
|
||||||
strokes.push_back(stroke2);
|
strokes.push_back(stroke2);
|
||||||
|
@ -175,8 +184,13 @@ gen::SymmetryMode Symmetry::resolveMode(gen::SymmetryMode mode)
|
||||||
{
|
{
|
||||||
return (((int(mode) & int(gen::SymmetryMode::HORIZONTAL)) ||
|
return (((int(mode) & int(gen::SymmetryMode::HORIZONTAL)) ||
|
||||||
(int(mode) & int(gen::SymmetryMode::VERTICAL))) &&
|
(int(mode) & int(gen::SymmetryMode::VERTICAL))) &&
|
||||||
((int(mode) & int(gen::SymmetryMode::RIGHT_DIAG)) ||
|
((int(mode) & int(gen::SymmetryMode::RIGHT_DIAG)) ||
|
||||||
(int(mode) & int(gen::SymmetryMode::LEFT_DIAG)))) ?
|
(int(mode) & int(gen::SymmetryMode::LEFT_DIAG)))) ||
|
||||||
|
((int(mode) & int(gen::SymmetryMode::POINT)) &&
|
||||||
|
((int(mode) & int(gen::SymmetryMode::RIGHT_DIAG)) ||
|
||||||
|
(int(mode) & int(gen::SymmetryMode::LEFT_DIAG)) ||
|
||||||
|
(int(mode) & int(gen::SymmetryMode::HORIZONTAL)) ||
|
||||||
|
(int(mode) & int(gen::SymmetryMode::VERTICAL)))) ?
|
||||||
gen::SymmetryMode::ALL :
|
gen::SymmetryMode::ALL :
|
||||||
mode;
|
mode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1502,7 +1502,7 @@ protected:
|
||||||
|
|
||||||
class ContextBar::SymmetryField : public ButtonSet {
|
class ContextBar::SymmetryField : public ButtonSet {
|
||||||
public:
|
public:
|
||||||
SymmetryField() : ButtonSet(5)
|
SymmetryField() : ButtonSet(6)
|
||||||
{
|
{
|
||||||
setMultiMode(MultiMode::Set);
|
setMultiMode(MultiMode::Set);
|
||||||
auto theme = SkinTheme::get(this);
|
auto theme = SkinTheme::get(this);
|
||||||
|
@ -1510,6 +1510,7 @@ public:
|
||||||
addItem(theme->parts.verticalSymmetry(), theme->styles.symmetryField());
|
addItem(theme->parts.verticalSymmetry(), theme->styles.symmetryField());
|
||||||
addItem(theme->parts.rightDiagonalSymmetry(), theme->styles.symmetryField());
|
addItem(theme->parts.rightDiagonalSymmetry(), theme->styles.symmetryField());
|
||||||
addItem(theme->parts.leftDiagonalSymmetry(), theme->styles.symmetryField());
|
addItem(theme->parts.leftDiagonalSymmetry(), theme->styles.symmetryField());
|
||||||
|
addItem(theme->parts.pointSymmetry(), theme->styles.symmetryField());
|
||||||
addItem("...", theme->styles.symmetryOptions());
|
addItem("...", theme->styles.symmetryOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1519,7 +1520,8 @@ public:
|
||||||
tooltipManager->addTooltipFor(at(1), Strings::symmetry_toggle_vertical(), BOTTOM);
|
tooltipManager->addTooltipFor(at(1), Strings::symmetry_toggle_vertical(), BOTTOM);
|
||||||
tooltipManager->addTooltipFor(at(2), Strings::symmetry_toggle_right_diagonal(), BOTTOM);
|
tooltipManager->addTooltipFor(at(2), Strings::symmetry_toggle_right_diagonal(), BOTTOM);
|
||||||
tooltipManager->addTooltipFor(at(3), Strings::symmetry_toggle_left_diagonal(), BOTTOM);
|
tooltipManager->addTooltipFor(at(3), Strings::symmetry_toggle_left_diagonal(), BOTTOM);
|
||||||
tooltipManager->addTooltipFor(at(4), Strings::symmetry_show_options(), BOTTOM);
|
tooltipManager->addTooltipFor(at(4), Strings::symmetry_toggle_point(), BOTTOM);
|
||||||
|
tooltipManager->addTooltipFor(at(5), Strings::symmetry_show_options(), BOTTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateWithCurrentDocument()
|
void updateWithCurrentDocument()
|
||||||
|
@ -1534,6 +1536,7 @@ public:
|
||||||
at(1)->setSelected(int(docPref.symmetry.mode()) & int(app::gen::SymmetryMode::VERTICAL));
|
at(1)->setSelected(int(docPref.symmetry.mode()) & int(app::gen::SymmetryMode::VERTICAL));
|
||||||
at(2)->setSelected(int(docPref.symmetry.mode()) & int(app::gen::SymmetryMode::RIGHT_DIAG));
|
at(2)->setSelected(int(docPref.symmetry.mode()) & int(app::gen::SymmetryMode::RIGHT_DIAG));
|
||||||
at(3)->setSelected(int(docPref.symmetry.mode()) & int(app::gen::SymmetryMode::LEFT_DIAG));
|
at(3)->setSelected(int(docPref.symmetry.mode()) & int(app::gen::SymmetryMode::LEFT_DIAG));
|
||||||
|
at(4)->setSelected(int(docPref.symmetry.mode()) & int(app::gen::SymmetryMode::POINT));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1556,14 +1559,16 @@ private:
|
||||||
mode |= int(app::gen::SymmetryMode::RIGHT_DIAG);
|
mode |= int(app::gen::SymmetryMode::RIGHT_DIAG);
|
||||||
if (at(3)->isSelected())
|
if (at(3)->isSelected())
|
||||||
mode |= int(app::gen::SymmetryMode::LEFT_DIAG);
|
mode |= int(app::gen::SymmetryMode::LEFT_DIAG);
|
||||||
|
if (at(4)->isSelected())
|
||||||
|
mode |= int(app::gen::SymmetryMode::POINT);
|
||||||
|
|
||||||
if (app::gen::SymmetryMode(mode) != docPref.symmetry.mode()) {
|
if (app::gen::SymmetryMode(mode) != docPref.symmetry.mode()) {
|
||||||
docPref.symmetry.mode(app::gen::SymmetryMode(mode));
|
docPref.symmetry.mode(app::gen::SymmetryMode(mode));
|
||||||
// Redraw symmetry rules
|
// Redraw symmetry rules
|
||||||
doc->notifyGeneralUpdate();
|
doc->notifyGeneralUpdate();
|
||||||
}
|
}
|
||||||
else if (at(4)->isSelected()) {
|
else if (at(5)->isSelected()) {
|
||||||
auto* item = at(4);
|
auto* item = at(5);
|
||||||
|
|
||||||
gfx::Rect bounds = item->bounds();
|
gfx::Rect bounds = item->bounds();
|
||||||
item->setSelected(false);
|
item->setSelected(false);
|
||||||
|
|
|
@ -934,6 +934,19 @@ void Editor::drawOneSpriteUnclippedRect(ui::Graphics* g,
|
||||||
topLeft,
|
topLeft,
|
||||||
bottomRight);
|
bottomRight);
|
||||||
}
|
}
|
||||||
|
if (mode & int(app::gen::SymmetryMode::POINT)) {
|
||||||
|
int smallestDimension = std::min(enclosingRect.w, enclosingRect.h);
|
||||||
|
g->drawHLine(
|
||||||
|
symmetryButtons & int(app::gen::SymmetryMode::POINT) ? color : semiTransparentColor,
|
||||||
|
enclosingRect.x + x - smallestDimension * 0.10f,
|
||||||
|
enclosingRect.y + y,
|
||||||
|
smallestDimension * 0.10f * 2.0f);
|
||||||
|
g->drawVLine(
|
||||||
|
(symmetryButtons & int(app::gen::SymmetryMode::POINT)) ? color : semiTransparentColor,
|
||||||
|
enclosingRect.x + x,
|
||||||
|
enclosingRect.y + y - smallestDimension * 0.10f,
|
||||||
|
smallestDimension * 0.10f * 2.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1030,7 +1030,8 @@ bool StandbyState::Decorator::getSymmetryHandles(Editor* editor, Handles& handle
|
||||||
|
|
||||||
if ((int(mode) & int(app::gen::SymmetryMode::HORIZONTAL)) ||
|
if ((int(mode) & int(app::gen::SymmetryMode::HORIZONTAL)) ||
|
||||||
(int(mode) & int(app::gen::SymmetryMode::RIGHT_DIAG)) ||
|
(int(mode) & int(app::gen::SymmetryMode::RIGHT_DIAG)) ||
|
||||||
(int(mode) & int(app::gen::SymmetryMode::LEFT_DIAG))) {
|
(int(mode) & int(app::gen::SymmetryMode::LEFT_DIAG)) ||
|
||||||
|
(int(mode) & int(app::gen::SymmetryMode::POINT))) {
|
||||||
double pos = symmetry.xAxis();
|
double pos = symmetry.xAxis();
|
||||||
gfx::PointF pt1, pt2;
|
gfx::PointF pt1, pt2;
|
||||||
|
|
||||||
|
@ -1051,7 +1052,8 @@ bool StandbyState::Decorator::getSymmetryHandles(Editor* editor, Handles& handle
|
||||||
|
|
||||||
if ((int(mode) & int(app::gen::SymmetryMode::VERTICAL)) ||
|
if ((int(mode) & int(app::gen::SymmetryMode::VERTICAL)) ||
|
||||||
(int(mode) & int(app::gen::SymmetryMode::RIGHT_DIAG)) ||
|
(int(mode) & int(app::gen::SymmetryMode::RIGHT_DIAG)) ||
|
||||||
(int(mode) & int(app::gen::SymmetryMode::LEFT_DIAG))) {
|
(int(mode) & int(app::gen::SymmetryMode::LEFT_DIAG)) ||
|
||||||
|
(int(mode) & int(app::gen::SymmetryMode::POINT))) {
|
||||||
double pos = symmetry.yAxis();
|
double pos = symmetry.yAxis();
|
||||||
gfx::PointF pt1, pt2;
|
gfx::PointF pt1, pt2;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue