summaryrefslogtreecommitdiff
path: root/scripts/addscopes.lua
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-20 03:58:52 +0100
committerRobin Gareus <robin@gareus.org>2017-02-20 03:58:52 +0100
commit120e75b420a4c756c71ce42bd0eea2565cde06ce (patch)
treee717c80b8570fce9860185af43b232ec081768b3 /scripts/addscopes.lua
parent0aa631b6afd07e749a1492c55367461459d34108 (diff)
And some more action-script icons
Diffstat (limited to 'scripts/addscopes.lua')
-rw-r--r--scripts/addscopes.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/addscopes.lua b/scripts/addscopes.lua
index deb3a5c814..5ff40a7da8 100644
--- a/scripts/addscopes.lua
+++ b/scripts/addscopes.lua
@@ -55,3 +55,20 @@ function factory (params)
end
end
end
+
+
+function icon (params) return function (ctx, width, height)
+ local wh = math.min (width, height) * .5
+ local x0 = math.ceil (wh * .4)
+ local x1 = math.floor (wh * 1.6)
+ ctx:rectangle (wh * .4, wh * .4, wh * 1.2, wh * 1.2)
+ ctx:set_source_rgba (.7, .7, .7, 1)
+ ctx:fill ()
+ ctx:set_line_width (1)
+ ctx:set_source_rgba (.0, .0, .0, 1)
+ ctx:move_to (x0, wh)
+ for x = x0, x1 do
+ ctx:line_to (x, wh - math.sin (2 * math.pi * (x-x0) / (x1-x0)) * wh * .5)
+ end
+ ctx:stroke ()
+end end