Correctly align non-square icons

This commit is contained in:
Matthias Schiffer 2011-07-17 22:09:19 +02:00
parent 4ffea6d426
commit bb316caf3b

View file

@ -237,6 +237,10 @@ instance WidgetClass Taskbar where
let scalef = (fromIntegral h')/(fromIntegral $ max imageW imageH) let scalef = (fromIntegral h')/(fromIntegral $ max imageW imageH)
case True of
_ | imageH < imageW -> translate 0 (fromIntegral (imageW-imageH)*scalef/2)
| otherwise -> translate (fromIntegral (imageH-imageW)*scalef/2) 0
renderWithSimilarSurface ContentColorAlpha h' h' $ \surface -> do renderWithSimilarSurface ContentColorAlpha h' h' $ \surface -> do
renderWith surface $ do renderWith surface $ do
downscaled scalef icon downscaled scalef icon