diff --git a/dotscape b/dotscape index 9b3ba00..4796235 100755 Binary files a/dotscape and b/dotscape differ diff --git a/fcore/move-mode.sml b/fcore/move-mode.sml index efc7aa6..de25963 100644 --- a/fcore/move-mode.sml +++ b/fcore/move-mode.sml @@ -5,7 +5,7 @@ struct open DrawMessage open UpdateMessage - (* todo: resize message, escape button to go back to normal mode *) + (* todo: resize message *) fun getDrawMsg (model: app_type) = let @@ -37,8 +37,13 @@ struct (model, [DRAW drawMsg]) end + val blankPixel = {r = 0, g = 0, b = 0, a = 0} + fun makeBlankYAxis length = - Vector.tabulate (length, fn _ => {r = 0, g = 0, b = 0, a = 0}) + Vector.tabulate (length, fn _ => blankPixel) + + fun makeBlankXAxis length = + Vector.tabulate (length, fn _ => makeBlankYAxis length) fun moveImageUp (model: app_type) = let @@ -46,11 +51,11 @@ struct val squares = Vector.mapi - (fn (idx, yAxis) => - if idx + 1 < Vector.length squares then - Vector.sub (squares, idx + 1) - else - makeBlankYAxis (Vector.length yAxis)) squares + (fn (_, yAxis) => + Vector.mapi + (fn (yIdx, pixel) => + if yIdx = Vector.length yAxis - 1 then blankPixel + else Vector.sub (yAxis, yIdx + 1)) yAxis) squares val model = AppWith.squares (model, squares) in @@ -63,9 +68,11 @@ struct val squares = Vector.mapi - (fn (idx, yAxis) => - if idx = 0 then makeBlankYAxis (Vector.length yAxis) - else Vector.sub (squares, idx - 1)) squares + (fn (_, yAxis) => + Vector.mapi + (fn (yIdx, pixel) => + if yIdx = 0 then blankPixel else Vector.sub (yAxis, yIdx - 1)) + yAxis) squares val model = AppWith.squares (model, squares) in