DIAG: improve readability
This commit is contained in:
parent
54d960ad20
commit
1dcc24064b
@ -180,8 +180,8 @@ squares = Diag f
|
|||||||
f _ (Object []) = mempty
|
f _ (Object []) = mempty
|
||||||
f p (Object vt) =
|
f p (Object vt) =
|
||||||
mconcat
|
mconcat
|
||||||
$ (\((xmin', xmax'), (ymin', ymax')) -> rect (xmax' - xmin') (ymax' - ymin')
|
$ (\((xmin, xmax), (ymin, ymax)) -> rect (xmax - xmin) (ymax - ymin)
|
||||||
# moveTo (p2 ((xmax' + xmin') / 2, (ymax' + ymin') / 2)) # lw ultraThin)
|
# moveTo (p2 ((xmax + xmin) / 2, (ymax + ymin) / 2)) # lw ultraThin)
|
||||||
<$> (quadTreeSquares (xDimension p, yDimension p) . quadTree vtf $ (xDimension p, yDimension p))
|
<$> (quadTreeSquares (xDimension p, yDimension p) . quadTree vtf $ (xDimension p, yDimension p))
|
||||||
where
|
where
|
||||||
vtf = filterValidPT p vt
|
vtf = filterValidPT p vt
|
||||||
@ -201,8 +201,8 @@ quadPathSquare = Diag f
|
|||||||
where
|
where
|
||||||
f _ (Object []) = mempty
|
f _ (Object []) = mempty
|
||||||
f p (Object vt) =
|
f p (Object vt) =
|
||||||
(\((xmin', xmax'), (ymin', ymax')) -> rect (xmax' - xmin') (ymax' - ymin')
|
(\((xmin, xmax), (ymin, ymax)) -> rect (xmax - xmin) (ymax - ymin)
|
||||||
# moveTo (p2 ((xmax' + xmin') / 2,(ymax' + ymin') / 2)) # lw thin # lc red)
|
# moveTo (p2 ((xmax + xmin) / 2,(ymax + ymin) / 2)) # lw thin # lc red)
|
||||||
(getSquare (stringToQuads (quadPath p)) (qt vt p, []))
|
(getSquare (stringToQuads (quadPath p)) (qt vt p, []))
|
||||||
where
|
where
|
||||||
getSquare :: [Either Quad Orient] -> Zipper PT -> Square
|
getSquare :: [Either Quad Orient] -> Zipper PT -> Square
|
||||||
@ -219,8 +219,8 @@ gifQuadPath :: Diag
|
|||||||
gifQuadPath = GifDiag f
|
gifQuadPath = GifDiag f
|
||||||
where
|
where
|
||||||
f p col _ vt =
|
f p col _ vt =
|
||||||
(\((xmin', xmax'), (ymin', ymax')) -> rect (xmax' - xmin') (ymax' - ymin')
|
(\((xmin, xmax), (ymin, ymax)) -> rect (xmax - xmin) (ymax - ymin)
|
||||||
# moveTo (p2 ((xmax' + xmin') / 2,(ymax' + ymin') / 2)) # lw thick # lc col)
|
# moveTo (p2 ((xmax + xmin) / 2,(ymax + ymin) / 2)) # lw thick # lc col)
|
||||||
<$> getSquares (stringToQuads (quadPath p)) (qt vt p, [])
|
<$> getSquares (stringToQuads (quadPath p)) (qt vt p, [])
|
||||||
where
|
where
|
||||||
getSquares :: [Either Quad Orient] -> Zipper PT -> [Square]
|
getSquares :: [Either Quad Orient] -> Zipper PT -> [Square]
|
||||||
|
Loading…
Reference in New Issue
Block a user