VEC: Fix the inRange function

It now takes a PROPER square, as in ((xmin, ymin), (xmax, ymax))
instead of ((xmin, xmax), (ymin, ymax)) and also works
with negative values.

Because the meaning of the arguments has changed, we also
had to fix all uses of it.
This commit is contained in:
2014-12-17 03:35:33 +01:00
parent c33827b63e
commit 2ccb52eb62
6 changed files with 59 additions and 33 deletions

View File

@@ -2,6 +2,7 @@
module GUI.Gtk (makeGUI) where
import Algebra.Vector (dimToSquare)
import Control.Applicative
import Control.Monad(unless)
import Control.Monad.IO.Class
@@ -308,8 +309,9 @@ saveAndDrawDiag fp fps mygui =
haveGrid = gridActive,
showCoordText = coordTextActive,
quadPath = quadPathEntry',
rangeSquare = (fromMaybe (0, 500) rxDim,
fromMaybe (0, 500) ryDim)
rangeSquare = case (rxDim, ryDim) of
(Just xd', Just yd') -> dimToSquare xd' yd'
_ -> ((0, 0), (500, 500))
})
mesh)
(s, r) = renderDiag daW daH diagS