mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-17 16:10:05 +00:00
Keep rotation angle inside -180...180 range when using Edit > Rotate commands
This commit is contained in:
parent
47ff85e871
commit
e19119cae2
2
laf
2
laf
@ -1 +1 @@
|
|||||||
Subproject commit 398bcf8ed588c63027beb80b107243e530f3a955
|
Subproject commit 3431eef7376429fefbde651e484a8d807628ded1
|
@ -164,7 +164,9 @@ void PixelsMovement::flipImage(doc::algorithm::FlipType flipType)
|
|||||||
void PixelsMovement::rotate(double angle)
|
void PixelsMovement::rotate(double angle)
|
||||||
{
|
{
|
||||||
ContextWriter writer(m_reader, 1000);
|
ContextWriter writer(m_reader, 1000);
|
||||||
m_currentData.angle(m_currentData.angle() + PI * -angle / 180.0);
|
m_currentData.angle(
|
||||||
|
base::fmod_radians(
|
||||||
|
m_currentData.angle() + PI * -angle / 180.0));
|
||||||
|
|
||||||
m_document->setTransformation(m_currentData);
|
m_document->setTransformation(m_currentData);
|
||||||
|
|
||||||
@ -399,9 +401,7 @@ void PixelsMovement::moveImage(const gfx::Point& pos, MoveModifier moveModifier)
|
|||||||
- atan2((double)(-m_catchPos.y + abs_initial_pivot.y),
|
- atan2((double)(-m_catchPos.y + abs_initial_pivot.y),
|
||||||
(double)(+m_catchPos.x - abs_initial_pivot.x));
|
(double)(+m_catchPos.x - abs_initial_pivot.x));
|
||||||
|
|
||||||
// Put the angle in -180 to 180 range.
|
newAngle = base::fmod_radians(newAngle);
|
||||||
while (newAngle < -PI) newAngle += 2*PI;
|
|
||||||
while (newAngle > PI) newAngle -= 2*PI;
|
|
||||||
|
|
||||||
// Is the "angle snap" is activated, we've to snap the angle
|
// Is the "angle snap" is activated, we've to snap the angle
|
||||||
// to common (pixel art) angles.
|
// to common (pixel art) angles.
|
||||||
|
Loading…
Reference in New Issue
Block a user