mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Fix some script icons for non-square buttons
This commit is contained in:
parent
7aaf212a9b
commit
cf8a808bd7
8 changed files with 14 additions and 10 deletions
|
|
@ -13,12 +13,12 @@ end end
|
|||
|
||||
function icon (params) return function (ctx, width, height, fg)
|
||||
ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
|
||||
local txt = Cairo.PangoLayout (ctx, "Sans ".. math.ceil(math.min (width, height) * .33) .. "px")
|
||||
local txt = Cairo.PangoLayout (ctx, "Sans ".. math.ceil(height / 3) .. "px")
|
||||
txt:set_alignment (Cairo.Alignment.Center);
|
||||
txt:set_width (width);
|
||||
txt:set_ellipsize (Cairo.EllipsizeMode.Middle);
|
||||
txt:set_text ("plot\ngraph")
|
||||
txt:set_text ("plot\ngrph")
|
||||
local tw, th = txt:get_pixel_size ()
|
||||
ctx:move_to (.5 * (width - tw), .5 * (height - th))
|
||||
ctx:move_to (0, .5 * (height - th))
|
||||
txt:show_in_cairo_context (ctx)
|
||||
end end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue