diff --git a/src/pycture/__init__.py b/src/pycture/__init__.py index a10afe9..f80b6f6 100644 --- a/src/pycture/__init__.py +++ b/src/pycture/__init__.py @@ -63,6 +63,7 @@ def add_editor(self, image: QImage = None, name: str = "", editor: Editor = None name = name + "+" + extension if editor: + editor.setWindowTitle(name) self.editors[name] = editor else: self.editors[name] = Editor(self, image, name) diff --git a/src/pycture/commands/edit_commands/rotate.py b/src/pycture/commands/edit_commands/rotate.py index 78ab0f8..9a03fbe 100644 --- a/src/pycture/commands/edit_commands/rotate.py +++ b/src/pycture/commands/edit_commands/rotate.py @@ -14,11 +14,16 @@ def __init__(self, parent: QWidget): } def apply_rotation(self, editor_title, interpolation_technique, angle): - image, title = self.get_active_image_and_title(self.main_window) + editor = self.main_window.editors.get(editor_title) + image = editor.get_image() + title = editor.windowTitle() + rotated_image = image.rotate( angle, self.interpolation_techniques[interpolation_technique]) + + str_angle = str(angle).replace(".", "'") self.main_window.add_editor(editor=Editor( - self.main_window, rotated_image, title + f' rotated {angle}º')) + self.main_window, rotated_image, title + f' rotated {str_angle}º')) def execute(self, main_window: QMainWindow): # Open dialog