From 626d5a3ffaac1eebef033b3b52952fd95a949a8d Mon Sep 17 00:00:00 2001 From: Evgeny Kurnevsky Date: Wed, 28 Jul 2021 10:21:35 +0300 Subject: [PATCH] Fix scale. Gtk requires size to be >0. --- src/StatusNotifier/Tray.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StatusNotifier/Tray.hs b/src/StatusNotifier/Tray.hs index 6bf1578..96ad0eb 100644 --- a/src/StatusNotifier/Tray.hs +++ b/src/StatusNotifier/Tray.hs @@ -55,7 +55,7 @@ getScaledWidthHeight shouldTargetWidth targetSize width height = getRatio toScale = fromIntegral targetSize / fromIntegral toScale getOther :: Int32 -> Int32 -> Int32 - getOther toScale other = floor $ getRatio toScale * fromIntegral other + getOther toScale other = max 1 $ floor $ getRatio toScale * fromIntegral other in if shouldTargetWidth then (targetSize, getOther width height)