progress towards resizing

This commit is contained in:
2024-08-02 12:46:00 +01:00
parent cff2b4f8df
commit 7a584fea3c
2 changed files with 20 additions and 2 deletions

BIN
dotscape

Binary file not shown.

View File

@@ -152,11 +152,29 @@ struct
val halfWidth = Real32.fromInt (windowWidth div 2)
val halfHeight = Real32.fromInt (windowHeight div 2)
val x1px = x1 * halfWidth
val x1px =
if windowWidth > windowHeight then
let
val difference = windowWidth - windowHeight
val offset = Real32.fromInt (difference div 2)
in
x1 * (halfWidth - offset)
end
else
x1 * halfWidth
val left = (x1px - 5.0) / halfWidth
val right = (x1px + 5.0) / halfWidth
val y1px = y1 * halfHeight
val y1px =
if windowHeight > windowWidth then
let
val difference = windowHeight - windowWidth
val offset = Real32.fromInt (difference div 2)
in
y1 * (halfHeight - offset)
end
else
y1 * halfHeight
val top = (y1px + 5.0) / halfHeight
val bottom = (y1px - 5.0) / halfHeight