image/rotation: Fix issuing edit for 0deg rotation

Rotating by 0 degrees went through the complete rotation pipeline including a image reload. Now, 0 deg rotations are ignored.
This commit is contained in:
Sophie Herold 2024-08-06 14:08:24 +02:00
parent 959a047816
commit ea3563493e
2 changed files with 8 additions and 5 deletions

View file

@ -103,11 +103,13 @@ impl LpImage {
}
if let Ok(r) = gufo_common::orientation::Rotation::try_from(angle) {
log::debug!("Editing image to rotate by {r:?}");
let operation = glycin::Operation::Rotate(r);
let editing_queue = &self.imp().editing_queue;
editing_queue.push(operation);
editing_queue.write_to_image(self);
if r != gufo_common::orientation::Rotation::_0 {
log::debug!("Editing image to rotate by {r:?}");
let operation = glycin::Operation::Rotate(r);
let editing_queue = &self.imp().editing_queue;
editing_queue.push(operation);
editing_queue.write_to_image(self);
}
}
}
}