mirror of
https://github.com/aseprite/aseprite.git
synced 2024-11-20 14:21:45 +00:00
Avoid RotSprite for 90/180 degree rotations
Reported several times: https://community.aseprite.org/t/better-90-180-rotation-from-menu/2937 https://community.aseprite.org/t/rotate-90-should-not-use-rotsprite/3267 https://community.aseprite.org/t/improvements-to-rotsprite/3613/4 https://community.aseprite.org/t/buggy-90-degree-rotation/3793
This commit is contained in:
parent
dcdde74cba
commit
47ff85e871
@ -736,11 +736,13 @@ void PixelsMovement::drawParallelogram(
|
|||||||
{
|
{
|
||||||
tools::RotationAlgorithm rotAlgo = Preferences::instance().selection.rotationAlgorithm();
|
tools::RotationAlgorithm rotAlgo = Preferences::instance().selection.rotationAlgorithm();
|
||||||
|
|
||||||
// If the angle and the scale weren't modified, we should use the
|
// When the scale isn't modified and we have no rotation or a
|
||||||
// fast rotation algorithm, as it's pixel-perfect match with the
|
// right/straight-angle, we should use the fast rotation algorithm,
|
||||||
// original selection when just a translation is applied.
|
// as it's pixel-perfect match with the original selection when just
|
||||||
if (m_currentData.angle() == 0.0 &&
|
// a translation is applied.
|
||||||
gfx::Rect(m_currentData.bounds()).size() == src->size()) {
|
double angle = 180.0*m_currentData.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) {
|
||||||
rotAlgo = tools::RotationAlgorithm::FAST;
|
rotAlgo = tools::RotationAlgorithm::FAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user