diff options
| author | Omar Rizwan <omar@omar.website> | 2023-10-12 16:49:00 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2023-10-12 16:49:00 +0000 |
| commit | 12a58eb55b1afd7dad5b9865b9e86fc85ac1d675 (patch) | |
| tree | ad980a975dbf613999dcedd8fc3b481f85136484 /virtual-programs | |
| parent | text: Batch glyphs into one wish -- fixes performance. (diff) | |
| download | folk-12a58eb55b1afd7dad5b9865b9e86fc85ac1d675.tar.gz folk-12a58eb55b1afd7dad5b9865b9e86fc85ac1d675.zip | |
display: Error on Display:: calls; implement titles with wish
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/display.folk | 2 | ||||
| -rw-r--r-- | virtual-programs/display/text.folk | 8 | ||||
| -rw-r--r-- | virtual-programs/title.folk | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/virtual-programs/display.folk b/virtual-programs/display.folk index 387d300a..ed3fb62d 100644 --- a/virtual-programs/display.folk +++ b/virtual-programs/display.folk @@ -20,7 +20,7 @@ namespace eval ::Display { foreach func {stroke circle text fillTriangle fillQuad fillPolygon} { proc $func args { set func [lindex [info level 0] 0] - uplevel [list Wish display runs [list $func {*}$args] on layer $::Display::LAYER] + error "$func has been removed; use GPU shaders" } } } diff --git a/virtual-programs/display/text.folk b/virtual-programs/display/text.folk index a6c828b9..14f0294a 100644 --- a/virtual-programs/display/text.folk +++ b/virtual-programs/display/text.folk @@ -103,8 +103,12 @@ On process "display" { [list /someone/ wishes to draw text with /...options/] When /someone/ wishes to draw text with /...options/ { - set x0 [dict get $options x] - set y0 [dict get $options y] + if {[dict exists $options center]} { + lassign [dict get $options center] x0 y0 + } else { + set x0 [dict get $options x] + set y0 [dict get $options y] + } set scale [dict_getdef $options scale 1.0] set text [dict get $options text] set radians [dict get $options radians] diff --git a/virtual-programs/title.folk b/virtual-programs/title.folk index fccacc17..3187ed3c 100644 --- a/virtual-programs/title.folk +++ b/virtual-programs/title.folk @@ -14,7 +14,7 @@ When /thing/ has region /region/ { if {$text eq ""} { return } set scale 1 - Display::text {*}$top $scale $text $radians + Wish to draw text with center $top scale $scale text $text radians $radians } When the collected matches for [list /someone/ wishes $thing is footnoted /text/] are /matches/ { @@ -22,6 +22,6 @@ When /thing/ has region /region/ { if {$text eq ""} { return } set scale 1 - Display::text {*}$bot $scale $text $radians + Wish to draw text with center $bot scale $scale text $text radians $radians } } |
