Revert "Add support for resizing notification icon with respect to aspect (#2176)"

This reverts commit 584c5cedb1.
This commit is contained in:
Emmanuel Lepage Vallee 2018-05-28 13:19:50 -04:00
parent 0703156155
commit a2f314c349
1 changed files with 2 additions and 8 deletions

View File

@ -22,7 +22,6 @@ local screen = require("awful.screen")
local util = require("awful.util")
local gtable = require("gears.table")
local gfs = require("gears.filesystem")
local gmath = require("gears.math")
local beautiful = require("beautiful")
local wibox = require("wibox")
local surface = require("gears.surface")
@ -766,14 +765,9 @@ function naughty.notify(args)
iconbox = wibox.widget.imagebox()
iconmargin = wibox.container.margin(iconbox, margin, margin, margin, margin)
if icon_size then
local scale_factor = icon_size / math.max(icon:get_height(),
icon:get_width())
local scaled =
cairo.ImageSurface(cairo.Format.ARGB32,
gmath.round(icon:get_width() * scale_factor),
gmath.round(icon:get_height() * scale_factor))
local scaled = cairo.ImageSurface(cairo.Format.ARGB32, icon_size, icon_size)
local cr = cairo.Context(scaled)
cr:scale(scale_factor, scale_factor)
cr:scale(icon_size / icon:get_height(), icon_size / icon:get_width())
cr:set_source_surface(icon, 0, 0)
cr:paint()
icon = scaled