aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/widgets/fixed_ratio_picture.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2025-02-16 20:51:28 +0100
committerMarvin W <git@larma.de>2025-02-22 11:27:48 +0100
commitefe39b8ea008cea3106fcc268d29d6f2bdf3c76e (patch)
tree2eb7a9f63dc751a2f31215598d07f6f564143740 /main/src/ui/widgets/fixed_ratio_picture.vala
parent21869c92a214b9be73b998375e166e01b2d21ff7 (diff)
downloaddino-efe39b8ea008cea3106fcc268d29d6f2bdf3c76e.tar.gz
dino-efe39b8ea008cea3106fcc268d29d6f2bdf3c76e.zip
Fix compatibility with GTK 4.17+
Diffstat (limited to 'main/src/ui/widgets/fixed_ratio_picture.vala')
-rw-r--r--main/src/ui/widgets/fixed_ratio_picture.vala6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/src/ui/widgets/fixed_ratio_picture.vala b/main/src/ui/widgets/fixed_ratio_picture.vala
index 3e83ec0c..ac68ff3e 100644
--- a/main/src/ui/widgets/fixed_ratio_picture.vala
+++ b/main/src/ui/widgets/fixed_ratio_picture.vala
@@ -62,12 +62,12 @@ class Dino.Ui.FixedRatioPicture : Gtk.Widget {
measure_target_size(out width, out height);
if (orientation == Orientation.HORIZONTAL) {
minimum = min_width;
- natural = width;
+ natural = int.max(min_width, int.min(width, max_width));
} else if (for_size == -1) {
minimum = min_height;
- natural = height;
+ natural = int.max(min_height, int.min(height, max_height));
} else {
- minimum = natural = height * for_size / width;
+ minimum = natural = int.max(min_height, int.min(height * for_size / width, max_height));
}
}