diff --git a/dotscape b/dotscape index 4cd8321..d953280 100755 Binary files a/dotscape and b/dotscape differ diff --git a/fcore/click-points.sml b/fcore/click-points.sml index 20a645f..9097afc 100644 --- a/fcore/click-points.sml +++ b/fcore/click-points.sml @@ -12,10 +12,18 @@ struct val pixelSize = Real32.min (xPixelSize, yPixelSize) + val actualWidth = pixelSize * realCanvasWidth + val actualHeight = pixelSize * realCanvasHeight + + val heightDifference = realWindowHeight - actualHeight + val yOffset = heightDifference / 2.0 + val widthDifference = realWindowWidth - actualWidth + val xOffset = widthDifference / 2.0 + val xClickPoints = Vector.tabulate (canvasWidth + 1, fn i => - Real32.fromInt i * pixelSize) + (Real32.fromInt i * pixelSize) + xOffset) val yClickPoints = Vector.tabulate (canvasHeight + 1, fn i => - Real32.fromInt i * pixelSize) + (Real32.fromInt i * pixelSize) + yOffset) in (xClickPoints, yClickPoints) end