editing: Fix wrong orientation for rotation

This commit is contained in:
Sophie Herold 2025-01-01 15:30:03 +01:00
parent 85fa5ba43f
commit f9f86e718f
2 changed files with 5 additions and 5 deletions

View file

@ -1,4 +1,4 @@
// Copyright (c) 2024 Sophie Herold
// Copyright (c) 2024-2025 Sophie Herold
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -139,7 +139,7 @@ impl OperationsSnapshot {
let y_center = self.height as f32 * self.scale / 2.;
snapshot.translate(&graphene::Point::new(y_center, x_center));
snapshot.rotate(rotation.degrees() as f32);
snapshot.rotate(-(rotation.degrees() as f32));
snapshot.translate(&graphene::Point::new(-x_center, -y_center));
snapshot.append_node(self.current_node.clone());

View file

@ -1,4 +1,4 @@
// Copyright (c) 2024 Sophie Herold
// Copyright (c) 2024-2025 Sophie Herold
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -295,13 +295,13 @@ mod imp {
}
fn apply_rotate_cw(&self) {
self.add_operation(Operation::Rotate(gufo_common::orientation::Rotation::_90));
self.add_operation(Operation::Rotate(gufo_common::orientation::Rotation::_270));
self.reset_selection();
}
fn apply_rotate_ccw(&self) {
self.add_operation(Operation::Rotate(gufo_common::orientation::Rotation::_270));
self.add_operation(Operation::Rotate(gufo_common::orientation::Rotation::_90));
self.reset_selection();
}