a bit of refactoring

This commit is contained in:
2024-10-08 08:53:43 +01:00
parent 68a1787958
commit 6e4cc9acff
6 changed files with 53 additions and 22 deletions

View File

@@ -8,12 +8,13 @@ struct
fun resizeText (app: app_type, newWidth, newHeight) =
let
val {buffer, windowWidth, windowHeight} = app
val (textVec, newBuffer) =
TextBuilder.build (0, buffer, newWidth, newHeight)
val {buffer, windowWidth, windowHeight, startLine} = app
val newApp =
{buffer = newBuffer, windowWidth = newWidth, windowHeight = newHeight}
val newBuffer = LineGap.goToLine (startLine, buffer)
val textVec =
TextBuilder.build (startLine, newBuffer, newWidth, newHeight)
val newApp = AppWith.bufferAndSize (app, newBuffer, newWidth, newHeight)
val msg = REDRAW_TEXT textVec
in
(newApp, [DRAW msg])