Add option to force RotSprite usage (as in old versions)

This commit is contained in:
David Capello 2019-09-05 18:19:55 -03:00
parent 3e391670b9
commit d03f5e9145
4 changed files with 7 additions and 2 deletions

View File

@ -246,6 +246,7 @@
<option id="modify_selection_quantity" type="int" default="1" />
<option id="modify_selection_brush" type="BrushType" default="BrushType::CIRCLE" />
<option id="doubleclick_select_tile" type="bool" default="true" />
<option id="force_rotsprite" type="bool" default="false" />
</section>
<section id="quantization">
<option id="with_alpha" type="bool" default="true" />

View File

@ -1054,6 +1054,7 @@ On "Add to selection" mode, we can move
the selection when the mouse is inside it.
END
select_tile_with_double_click = Select a grid tile with double-click
force_rotsprite = Force RotSprite even for right/straight angles
autotimeline = Show timeline automatically
autotimeline_tooltip = <<<END
Show the timeline automatically

View File

@ -222,6 +222,8 @@
<check text="@.move_on_add_mode" id="move_on_add_mode" tooltip="@.move_on_add_mode_tooltip" />
<check text="@.select_tile_with_double_click" id="select_tile_with_double_click"
pref="selection.doubleclick_select_tile" />
<check text="@.force_rotsprite" id="force_rotsprite"
pref="selection.force_rotsprite"/>
</vbox>
<!-- Timeline -->

View File

@ -856,8 +856,9 @@ void PixelsMovement::drawParallelogram(
// as it's pixel-perfect match with the original selection when just
// a translation is applied.
double angle = 180.0*transformation.angle()/PI;
if (std::fabs(std::fmod(std::fabs(angle), 90.0)) < 0.01 ||
std::fabs(std::fmod(std::fabs(angle), 90.0)-90.0) < 0.01) {
if (!Preferences::instance().selection.forceRotsprite() &&
(std::fabs(std::fmod(std::fabs(angle), 90.0)) < 0.01 ||
std::fabs(std::fmod(std::fabs(angle), 90.0)-90.0) < 0.01)) {
rotAlgo = tools::RotationAlgorithm::FAST;
}