summaryrefslogtreecommitdiffstats
path: root/virtual-programs
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2022-12-01 20:17:54 +0000
committerOmar Rizwan <omar@omar.website>2022-12-01 20:17:54 +0000
commited74ef0abc8e508aa77aed14ef416aad5eb47d99 (patch)
tree3fdbdc2bbbb49f1abc6cbbe4ef81fe775beb0287 /virtual-programs
parentincomplete README note about udev (diff)
downloadfolk-ed74ef0abc8e508aa77aed14ef416aad5eb47d99.tar.gz
folk-ed74ef0abc8e508aa77aed14ef416aad5eb47d99.zip
Fix line order for upside-down labels
Diffstat (limited to 'virtual-programs')
-rw-r--r--virtual-programs/label.folk3
1 files changed, 2 insertions, 1 deletions
diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk
index f0b4fdc3..8b97c152 100644
--- a/virtual-programs/label.folk
+++ b/virtual-programs/label.folk
@@ -14,7 +14,8 @@ 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] $radians
+ set ly [expr {abs($radians) < 1.57 ? $y-$lineNum*18 : $y+$lineNum*18}]
+ Display::text device $x $ly $fontSize [lindex $lines $lineNum] $radians
}
}
}