Commit dab3c31e authored by Bas Lijnse's avatar Bas Lijnse

Added circle example program

parent 842d9296
Pipeline #30015 passed with stage
in 4 minutes and 36 seconds
module Circles
import iTasks => qualified grid
import Data.Func
from Graphics.Scalable.Internal.Types import :: LookupSpan
import iTasks.Extensions.SVG.SVGEditor
Start w = doTasks gui6 w
gui6 :: Task [(Span, Span, Span)]
gui6 = updateInformation
[UpdateUsing id (const id) (fromSVGEditor svged)]
[(px 5.0, px 5.0, px 5.0)]
svged :: SVGEditor [(Span, Span, Span)] [(Span, Span, Span)]
svged = {initView=id, renderImage=renderImage, updModel= \m v->v}
renderImage _ images ts
= overlay [(AtMiddleX, AtMiddleY)] [(px 0.0, px 0.0)] [img]
$ Host $ rect (px 1000.0) (px 1000.0) <@< {fill=toSVGColor "white"}
img = collage [(x, y)\\(_, x, y)<-images] [circle r\\(r, _, _)<-images]
$ Host $ rect (px 100.0) (px 100.0)
<@< {fill=toSVGColor "white"}
<@< {onclick= \(x, y) m->[(px 5.0, x, y):m],local=False}
derive gEditor FontDef`
derive gText FontDef`
derive class iTask Span, LookupSpan, ImageTag
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment