diff options
| author | Andrés Cuervo <andrescuervor@gmail.com> | 2023-09-18 21:21:10 +0000 |
|---|---|---|
| committer | Andrés Cuervo <andrescuervor@gmail.com> | 2023-09-18 21:21:10 +0000 |
| commit | 1995b73386ec1dc4844c63fbb0a756c450e1e194 (patch) | |
| tree | a75d9bee14161b30659f390a8077850b74f0ca7d /virtual-programs | |
| parent | Add debugging info and fix editor file to match terminal keyboard (diff) | |
| download | folk-1995b73386ec1dc4844c63fbb0a756c450e1e194.tar.gz folk-1995b73386ec1dc4844c63fbb0a756c450e1e194.zip | |
Correctly angle editor text
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/editor.folk | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/virtual-programs/editor.folk b/virtual-programs/editor.folk index 418e9cec..2a557e55 100644 --- a/virtual-programs/editor.folk +++ b/virtual-programs/editor.folk @@ -115,16 +115,18 @@ proc newRegion {program x y w h} { # NOTE: This is convenient for me debugging (gets triggered with Ctrl + R) # but should probably be "Claim this has halo message editor" or something # not as intrusive as outlining to start? Just a thought. -set baseCode "Wish $id is outlined blue" +set baseCode "Wish $id is outlined blue\nWish $this is labelled hello" Commit code { Claim $id has program code $baseCode } proc drawText {text cursor count region} { set lineNumber 1 set showCursor [expr {$count % 2 == 0}] - set corner [lindex $region 0 1] + set corner [lindex $region 0 0] + set angle [region angle $region] lassign $corner cornerX cornerY foreach line [split $text "\n"] { - Display::text $cornerX $cornerY 5 $line 0 + Display::text $cornerX $cornerY 2 $line $angle + set lineNumber [+ $lineNumber 1] } } @@ -160,7 +162,7 @@ Every time keyboard claims key /currentCharacter/ is down with modifiers /modifi # Note: Still need to figure out the exact & text manipulation methods for all the # different cases of enter. This is just a simple one for now. # Claim cursor is [updateCursor $cursor {x [expr {-1 * [x $cursor]}] y 1}] - Claim cursor is [updateCursor $cursor {x -1 y 1}] + Claim cursor is [updateCursor $cursor {x 0 y 1}] # NOTE: Useful debugging print line, still figuring out the math. # Unforuntately this doesn't have consistent cursor spacing as the # X-coordinate increases. |
