summaryrefslogtreecommitdiff
path: root/src/MediaPage.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-14 20:35:58 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-14 20:35:58 +0200
commitd443a3c2509889533ca812c163056bace396b586 (patch)
treee94ffc0d9c054ca4efb8fb327e18dfac88e15dc7 /src/MediaPage.vala
parentbb9797c14470641b082ebf635e2ae3cfd5f27a3b (diff)
New upstream version 0.32.1upstream/0.32.1
Diffstat (limited to 'src/MediaPage.vala')
-rw-r--r--src/MediaPage.vala7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/MediaPage.vala b/src/MediaPage.vala
index f849ac3..5fa3fca 100644
--- a/src/MediaPage.vala
+++ b/src/MediaPage.vala
@@ -90,10 +90,7 @@ public abstract class MediaPage : CheckerboardPage {
}
public static double scale_to_slider(int value) {
- assert(value >= Thumbnail.MIN_SCALE);
- assert(value <= Thumbnail.MAX_SCALE);
-
- return (double) ((value - Thumbnail.MIN_SCALE) / SLIDER_STEPPING);
+ return (double) ((value.clamp(Thumbnail.MIN_SCALE, Thumbnail.MAX_SCALE) - Thumbnail.MIN_SCALE) / SLIDER_STEPPING);
}
public static int slider_to_scale(double value) {
@@ -887,7 +884,7 @@ public abstract class MediaPage : CheckerboardPage {
case SortBy.EXPOSURE_DATE:
if (ascending)
comparator = Thumbnail.exposure_time_ascending_comparator;
- else comparator = Thumbnail.exposure_time_desending_comparator;
+ else comparator = Thumbnail.exposure_time_descending_comparator;
predicate = Thumbnail.exposure_time_comparator_predicate;
break;