From 4f071fcdcfd5b6505a9ba326ff7716956f37827b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Cuervo?= Date: Thu, 26 Jan 2023 14:54:15 -0500 Subject: Add (kludgy) outline thickness --- virtual-programs/outline.folk | 22 +++++++++++++++++----- virtual-programs/test.folk | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'virtual-programs') 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 -- cgit v1.2.3