From f9294899d0b952072de3dc87b3ea97e98f150ea4 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 5 Nov 2016 20:34:09 -0700 Subject: 3622 - handle fractional coordinates in print --- html/081print.mu.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'html/081print.mu.html') diff --git a/html/081print.mu.html b/html/081print.mu.html index 241cf857..5214e80c 100644 --- a/html/081print.mu.html +++ b/html/081print.mu.html @@ -141,11 +141,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color height:num <- get *screen, num-rows:offset # if cursor is out of bounds, silently exit row:num <- get *screen, cursor-row:offset + row <- round row legal?:bool <- greater-or-equal row, 0 return-unless legal? legal? <- lesser-than row, height return-unless legal? column:num <- get *screen, cursor-column:offset + column <- round column legal? <- greater-or-equal column, 0 return-unless legal? legal? <- lesser-than column, width @@ -220,6 +222,25 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] ] +scenario print-character-at-fractional-coordinate [ + local-scope + fake-screen:&:screen <- new-fake-screen 3/width, 2/height + a:char <- copy 97/a + run [ + move-cursor fake-screen, 0.5, 0 + fake-screen <- print fake-screen, a:char + cell:&:@:screen-cell <- get *fake-screen, data:offset + 1:@:screen-cell/raw <- copy *cell + ] + memory-should-contain [ + 1 <- 6 # width*height + 2 <- 97 # 'a' + 3 <- 7 # white + # rest of screen is empty + 4 <- 0 + ] +] + scenario print-character-in-color [ local-scope fake-screen:&:screen <- new-fake-screen 3/width, 2/height -- cgit 1.4.1-2-gfad0