summaryrefslogtreecommitdiffstats
path: root/virtual-programs
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2022-10-18 22:57:43 +0000
committerOmar Rizwan <omar@omar.website>2022-10-18 22:57:43 +0000
commitdabca139603f1dc0f3ed61e6f8d225bb5532bd02 (patch)
tree1acc725e9f757db600a4888d5881e34613d7af09 /virtual-programs
parentFix trie leak (diff)
downloadfolk-dabca139603f1dc0f3ed61e6f8d225bb5532bd02.tar.gz
folk-dabca139603f1dc0f3ed61e6f8d225bb5532bd02.zip
Flip matching
Diffstat (limited to 'virtual-programs')
-rw-r--r--virtual-programs/highlight.folk4
-rw-r--r--virtual-programs/label.folk4
2 files changed, 4 insertions, 4 deletions
diff --git a/virtual-programs/highlight.folk b/virtual-programs/highlight.folk
index 81150127..113bdc92 100644
--- a/virtual-programs/highlight.folk
+++ b/virtual-programs/highlight.folk
@@ -1,5 +1,5 @@
-When /rect/ is a rectangle with x /x/ y /y/ width /width/ height /height/ {
- When /someone/ wishes $rect is highlighted /color/ {
+When /someone/ wishes /rect/ is highlighted /color/ {
+ When $rect is a rectangle with x /x/ y /y/ width /width/ height /height/ {
# it's not really correct to just stick a side-effect in the
# When handler like this. but we did it in Realtalk, and it
# was ok, so whatever for now
diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk
index 84361512..d30296ec 100644
--- a/virtual-programs/label.folk
+++ b/virtual-programs/label.folk
@@ -1,5 +1,5 @@
-When /rect/ is a rectangle with x /x/ y /y/ width /width/ height /height/ {
- When /someone/ wishes $rect is labelled /text/ {
+When /someone/ wishes /rect/ is labelled /text/ {
+ When $rect is a rectangle with x /x/ y /y/ width /width/ height /height/ {
set lines [split $text "\n"]
set longestLineLength [tcl::mathfunc::max {*}[lmap line $lines {string length $line}]]
set fontSize [expr $width / $longestLineLength]