diff options
Diffstat (limited to 'src/MediaPage.vala')
-rw-r--r-- | src/MediaPage.vala | 7 |
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; |