diff --git a/dotscape b/dotscape index d953280..2e99193 100755 Binary files a/dotscape and b/dotscape differ diff --git a/fcore/ndc.sml b/fcore/ndc.sml index fcf0177..64ad511 100644 --- a/fcore/ndc.sml +++ b/fcore/ndc.sml @@ -24,33 +24,17 @@ struct fun fromPixelX (xpos, windowWidth, windowHeight) = let - val halfWidth = Real32.fromInt (windowWidth div 2) + val halfWidth = Real32.fromInt windowWidth / 2.0 val xpos = xpos - halfWidth in - if windowWidth > windowHeight then - let - val difference = windowWidth - windowHeight - val offset = Real32.fromInt (difference div 2) - in - xpos / (halfWidth - offset) - end - else - xpos / halfWidth + xpos / halfWidth end fun fromPixelY (ypos, windowWidth, windowHeight) = let - val halfHeight = Real32.fromInt (windowHeight div 2) + val halfHeight = Real32.fromInt windowHeight / 2.0 val ypos = ~(ypos - halfHeight) in - if windowHeight > windowWidth then - let - val difference = windowHeight - windowWidth - val offset = Real32.fromInt (difference div 2) - in - ypos / (halfHeight - offset) - end - else - ypos / halfHeight + ypos / halfHeight end end