diff options
| author | Andrés Cuervo <acwervo@gmail.com> | 2023-01-26 19:54:15 +0000 |
|---|---|---|
| committer | Andrés Cuervo <acwervo@gmail.com> | 2023-01-26 19:54:15 +0000 |
| commit | 4f071fcdcfd5b6505a9ba326ff7716956f37827b (patch) | |
| tree | 94bda4fc5ea54fd8aa952e1f00cc294bd8f1d5d3 /virtual-programs | |
| parent | Color code connected message in web editor (diff) | |
| download | folk-4f071fcdcfd5b6505a9ba326ff7716956f37827b.tar.gz folk-4f071fcdcfd5b6505a9ba326ff7716956f37827b.zip | |
Add (kludgy) outline thickness
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/outline.folk | 22 | ||||
| -rw-r--r-- | virtual-programs/test.folk | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/virtual-programs/outline.folk b/virtual-programs/outline.folk index 999fe2f0..c2c46b4f 100644 --- a/virtual-programs/outline.folk +++ b/virtual-programs/outline.folk @@ -1,14 +1,26 @@ Wish $this has filename "outline.folk" -When /someone/ wishes /thing/ is outlined /color/ { - When $thing has region /region/ { - # FIXME: assumes path - lassign $region vertices edges + +proc loopRegion {edges vertices weight color} { foreach edge $edges { set from [lindex $vertices [lindex $edge 0]] set to [lindex $vertices [lindex $edge 1]] - Display::stroke [list $from $to] 4 $color + Display::stroke [list $from $to] $weight $color } +} + +When /someone/ wishes /thing/ is outlined /color/ { + When $thing has region /region/ { + # FIXME: assumes path + lassign $region vertices edges + loopRegion $edges $vertices 3 $color } } +When /someone/ wishes /thing/ is outlined thick /color/ { + When $thing has region /region/ { + # FIXME: assumes path + lassign $region vertices edges + loopRegion $edges $vertices 6 $color + } +}
\ No newline at end of file diff --git a/virtual-programs/test.folk b/virtual-programs/test.folk index fee4e01e..a8b18633 100644 --- a/virtual-programs/test.folk +++ b/virtual-programs/test.folk @@ -13,4 +13,4 @@ When $this has region /r/ { Display::stroke [list [list $a $b] [list $c $d]] 3 skyblue } -Wish $this is outlined green
\ No newline at end of file +Wish $this is outlined thick magenta
\ No newline at end of file |
