image: Use convention that rotations is always CCW

This commit is contained in:
Sophie Herold 2025-02-22 00:23:28 +01:00
parent 2cfaf865c3
commit 341aef672e
10 changed files with 22 additions and 22 deletions

8
Cargo.lock generated
View file

@ -831,7 +831,7 @@ dependencies = [
[[package]]
name = "glycin"
version = "2.1.0-beta"
source = "git+https://gitlab.gnome.org/GNOME/glycin.git?rev=08d7799d6c29c544bfe6914d4e7921bbbeb5f3ff#08d7799d6c29c544bfe6914d4e7921bbbeb5f3ff"
source = "git+https://gitlab.gnome.org/GNOME/glycin.git?rev=1fa8de634adb5d5e5fcac3aee58290b4374b09da#1fa8de634adb5d5e5fcac3aee58290b4374b09da"
dependencies = [
"async-fs",
"async-io",
@ -862,7 +862,7 @@ dependencies = [
[[package]]
name = "glycin-utils"
version = "3.0.0-beta"
source = "git+https://gitlab.gnome.org/GNOME/glycin.git?rev=08d7799d6c29c544bfe6914d4e7921bbbeb5f3ff#08d7799d6c29c544bfe6914d4e7921bbbeb5f3ff"
source = "git+https://gitlab.gnome.org/GNOME/glycin.git?rev=1fa8de634adb5d5e5fcac3aee58290b4374b09da#1fa8de634adb5d5e5fcac3aee58290b4374b09da"
dependencies = [
"env_logger",
"gufo-common",
@ -1016,9 +1016,9 @@ dependencies = [
[[package]]
name = "gufo-common"
version = "0.2.0-alpha.1"
version = "0.2.0-alpha.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34b07b8af7ba58b6c455183ca059e6e39e461996582ec6b140a374b3201c3c05"
checksum = "90c3526dee6b3d1a2a8314538086d70092603c3363025d2b047e3abea1054336"
dependencies = [
"chrono",
"paste",

View file

@ -29,13 +29,13 @@ gettext-sys = { version = "0.22.5", features = ["gettext-system"] }
gio = { version = "0.20.0", features = ["v2_74"] }
glycin = { version = "2.1.0-beta", features = [
"gdk4",
], git = "https://gitlab.gnome.org/GNOME/glycin.git", rev = "08d7799d6c29c544bfe6914d4e7921bbbeb5f3ff" }
gtk = { package = "gtk4", version = "0.9.6", features = [
], git = "https://gitlab.gnome.org/GNOME/glycin.git", rev = "1fa8de634adb5d5e5fcac3aee58290b4374b09da" }
gtk = { package = "gtk4", version = "0.9.5", features = [
"v4_14",
"xml_validation",
] }
gufo = { version = "0.2.0-alpha.1", features = ["chrono", "all-image-formats"] }
gufo-common = { version = "0.2.0-alpha", features = ["serde"] }
gufo-common = { version = "0.2.0-alpha.2", features = ["serde"] }
gvdb-macros = "0.1.6"
indexmap = "2.0.0"
libc = "0.2.158"

View file

@ -113,7 +113,7 @@
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/glycin.git",
"commit": "08d7799d6c29c544bfe6914d4e7921bbbeb5f3ff"
"commit": "1fa8de634adb5d5e5fcac3aee58290b4374b09da"
}
]
},

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
@ -72,7 +72,7 @@ impl Queue {
let edit_instruction = editor.apply_sparse(operations).await?;
if edit_instruction.apply_to(file).await? == EditOutcome::Unchanged {
log::error!("Writing new files is not supported yet");
log::warn!("Writing new files is not supported yet");
}
Ok(())

View file

@ -176,9 +176,9 @@ mod imp {
pub(super) decoder: RefCell<Option<Arc<Decoder>>>,
pub(super) overwrite_dimensions: Cell<Option<(u32, u32)>>,
/// Rotation final value (can differ from `rotation` during animation)
/// Rotation CCW final value (can differ from `rotation` during animation)
pub(super) rotation_target: Cell<f64>,
/// Rotated presentation of original image in degrees clockwise
/// Rotated CCW presentation of original image in degrees clockwise
#[property(get, set = Self::set_rotation, explicit_notify)]
pub(super) rotation: Cell<f64>,
// Animates the `rotation` property

View file

@ -239,7 +239,7 @@ impl imp::LpImage {
#[weak]
obj,
move |gesture, _, _| {
let angle = gesture.angle_delta().to_degrees();
let angle = -gesture.angle_delta().to_degrees();
// Only reset rotation if scale gesture is locked in
if let Some(Gesture::Scale) = obj.imp().locked_gestured.get() {

View file

@ -1,4 +1,4 @@
// Copyright (c) 2023-2024 Sophie Herold
// Copyright (c) 2023-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
@ -249,7 +249,7 @@ impl imp::LpImage {
));
// Apply the transformations from properties
snapshot.rotate(rotation);
snapshot.rotate(-rotation);
if mirrored {
snapshot.scale(-1., 1.);
}

View file

@ -1,4 +1,4 @@
// Copyright (c) 2023-2024 Sophie Herold
// Copyright (c) 2023-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
@ -78,9 +78,9 @@ impl LpImage {
let orientation = self.metadata().orientation();
self.imp()
.rotation_target
.set(-(orientation.rotate().degrees() as f64));
.set(orientation.rotate().degrees() as f64);
self.set_mirrored(orientation.mirror());
self.set_rotation(-(orientation.rotate().degrees() as f64));
self.set_rotation(orientation.rotate().degrees() as f64);
}
pub fn rotate_by(&self, angle: f64) {

View file

@ -1,4 +1,4 @@
// Copyright (c) 2022-2024 Sophie Herold
// Copyright (c) 2022-2025 Sophie Herold
// Copyright (c) 2022, 2024 Christopher Davis
//
// This program is free software: you can redistribute it and/or modify

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
@ -154,13 +154,13 @@ impl Action {
// Rotation/Zoom
Action::RotateCw => {
klass.install_action(&action, None, |win, _, _| {
win.rotate_image(90.0);
win.rotate_image(-90.0);
});
}
Action::RotateCcw => {
klass.install_action(&action, None, |win, _, _| {
win.rotate_image(-90.0);
win.rotate_image(90.0);
});
}