Correctly align non-square icons
This commit is contained in:
parent
4ffea6d426
commit
bb316caf3b
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||||
|
|
Reference in a new issue