diff options
author | Robin Gareus <robin@gareus.org> | 2017-02-20 00:53:09 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-02-20 00:53:09 +0100 |
commit | 83aac1ce881caa789231cec4a06f63f1a6bcc89b (patch) | |
tree | 409efc7a5dd1685d87fc036ba77cab15ac79244f /scripts/bounce_replace.lua | |
parent | 8d8666d041f0d0336a48389176ec0631c45cc6ff (diff) |
Add 2 more action-script icons
Diffstat (limited to 'scripts/bounce_replace.lua')
-rw-r--r-- | scripts/bounce_replace.lua | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/bounce_replace.lua b/scripts/bounce_replace.lua index 8e6ddd6211..838fd8da64 100644 --- a/scripts/bounce_replace.lua +++ b/scripts/bounce_replace.lua @@ -62,3 +62,39 @@ function factory (params) return function () end end end + +function icon (params) return function (ctx, width, height, fg) + local wh = math.min (width, height) * .5 + local ar = wh * .2 + + ctx:set_line_width (1) + function stroke_outline (c) + ctx:set_source_rgba (0, 0, 0, 1) + ctx:stroke_preserve () + ctx:set_source_rgba (c, c, c, 1) + ctx:fill () + end + + ctx:rectangle (wh - wh * .6, wh - .7 * wh, wh * 1.2, .5 * wh) + stroke_outline (.7) + + ctx:rectangle (wh - wh * .6, wh + .1 * wh, wh * 1.2, .5 * wh) + stroke_outline (.9) + + -- arrow + ctx:set_source_rgba (0, 1, 0, 1) + ctx:set_line_width (ar * .7) + + ctx:move_to (wh, wh - .5 * wh) + ctx:rel_line_to (0, wh) + ctx:stroke () + + ctx:move_to (wh, wh + .5 * wh) + ctx:rel_line_to (-ar, -ar) + ctx:rel_line_to (2 * ar, 0) + ctx:close_path () + ctx:stroke () + + + +end end |