diff options
| author | Omar Rizwan <omar@omar.website> | 2022-12-01 20:12:50 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2022-12-01 20:12:50 +0000 |
| commit | 3f6d2ee821f6d8d9f0288dbbebabf9d4986b00b2 (patch) | |
| tree | 298502ec7c34dcf6c32e861b7a423d08ee2dc001 /virtual-programs | |
| parent | Async Unix commands program (diff) | |
| download | folk-3f6d2ee821f6d8d9f0288dbbebabf9d4986b00b2.tar.gz folk-3f6d2ee821f6d8d9f0288dbbebabf9d4986b00b2.zip | |
Hack to draw upside-down text. It doesn't get line order right yet
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/label.folk | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk index b3ed5222..f0b4fdc3 100644 --- a/virtual-programs/label.folk +++ b/virtual-programs/label.folk @@ -4,6 +4,7 @@ When /someone/ wishes /thing/ is labelled /text/ { When $thing has region /region/ { set radians [lindex $region 2] if {$radians eq ""} {set radians 0} + set bbox [regionToBbox $region] lassign [boxCentroid $bbox] x y set width [boxWidth $bbox] @@ -13,6 +14,7 @@ When /someone/ wishes /thing/ is labelled /text/ { set longestLineLength [tcl::mathfunc::max {*}[lmap line $lines {string length $line}]] set fontSize [expr {$width / $longestLineLength}] for {set lineNum 0} {$lineNum < [llength $lines]} {incr lineNum} { - Display::text device $x [expr {$y+$lineNum*18}] $fontSize [lindex $lines $lineNum] 0 } + Display::text device $x [expr {$y+$lineNum*18}] $fontSize [lindex $lines $lineNum] $radians + } } } |
