From ce6775641639943a2aee00fa9c2d684aa434bc21 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 15 Mar 2015 09:40:58 +0100 Subject: Moving boardSize to Game model --- src/Utils/Geometry.elm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Utils') diff --git a/src/Utils/Geometry.elm b/src/Utils/Geometry.elm index 085026f..323422b 100644 --- a/src/Utils/Geometry.elm +++ b/src/Utils/Geometry.elm @@ -5,7 +5,6 @@ module Utils.Geometry ) where import Model.Vec2 (..) -import Model.Board (boardSize) polarToCartesian : Float -> Float -> Vec2 polarToCartesian angle dist = @@ -16,8 +15,8 @@ polarToCartesian angle dist = distance : Vec2 -> Vec2 -> Float distance v1 v2 = sqrt((v2.x - v1.x)^2 + (v2.y - v1.y)^2) -inBoard : Float -> Vec2 -> Vec2 -inBoard size pos = +inBoard : Vec2 -> Float -> Vec2 -> Vec2 +inBoard boardSize size pos = let leftX = -boardSize.x / 2 + size rightX = boardSize.x / 2 - size bottomY = -boardSize.y / 2 + size -- cgit v1.2.3