about summary refs log tree commit diff stats
path: root/501draw-text.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-08-28 22:57:22 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-08-28 22:57:22 -0700
commitbc859a7ca4713b290fa9d7dea187fde55568ab29 (patch)
tree39401d36682fe391816f1ce5bbceabf065524c7b /501draw-text.mu
parent468927ee1c8b551e50bc4a9e3a2ed689420e1766 (diff)
downloadmu-bc859a7ca4713b290fa9d7dea187fde55568ab29.tar.gz
.
Diffstat (limited to '501draw-text.mu')
-rw-r--r--501draw-text.mu10
1 files changed, 7 insertions, 3 deletions
diff --git a/501draw-text.mu b/501draw-text.mu
index d87fc04a..9f526497 100644
--- a/501draw-text.mu
+++ b/501draw-text.mu
@@ -81,17 +81,21 @@ fn move-cursor-to-left-margin-of-next-line screen: (addr screen) {
   set-cursor-position screen, cursor-x, cursor-y
 }
 
-fn draw-grapheme-at-cursor screen: (addr screen), g: grapheme, color: int, background-color: int {
+fn draw-grapheme-at-cursor-over-full-screen screen: (addr screen), g: grapheme, color: int, background-color: int {
   var cursor-x/eax: int <- copy 0
   var cursor-y/ecx: int <- copy 0
   cursor-x, cursor-y <- cursor-position screen
   draw-grapheme screen, g, cursor-x, cursor-y, color, background-color
+  var width/eax: int <- copy 0
+  var dummy/ecx: int <- copy 0
+  width, dummy <- screen-size screen
+  move-cursor-rightward-and-downward screen, 0 width
 }
 
 # we can't really render non-ASCII yet, but when we do we'll be ready
-fn draw-code-point-at-cursor screen: (addr screen), c: code-point, color: int, background-color: int {
+fn draw-code-point-at-cursor-over-full-screen screen: (addr screen), c: code-point, color: int, background-color: int {
   var g/eax: grapheme <- copy c
-  draw-grapheme-at-cursor screen, g, color, background-color
+  draw-grapheme-at-cursor-over-full-screen screen, g, color, background-color
 }
 
 # draw a single line of text from x, y to xmax