Correct room link position numbering

This commit is contained in:
2021-11-22 16:42:19 +00:00
parent b4759e4a27
commit 5d9ea4b733
23 changed files with 184 additions and 85 deletions
+10 -5
View File
@@ -18,17 +18,22 @@ atFstLnkOut = PSPos f (const id) Nothing
f (OutLink 0 p a) = Just (PS p a, OutLink 0 p a)
f _ = Nothing
atFstLnkOutShiftBy :: ((Point2,Float) -> (Point2,Float))
-> PlacementSpot
atFstLnkOutShiftBy theshift = PSPos f (const id) Nothing
atNthLnkOutShiftBy :: Int -> ((Point2,Float) -> (Point2,Float)) -> PlacementSpot
atNthLnkOutShiftBy n theshift = PSPos f (const id) Nothing
where
f (OutLink 0 p a) = Just (PS p' a', OutLink 0 p a)
f (OutLink i p a) | n == i = Just (PS p' a', OutLink n p a)
where
(p',a') = theshift (p,a)
f _ = Nothing
atFstLnkOutShiftBy :: ((Point2,Float) -> (Point2,Float)) -> PlacementSpot
atFstLnkOutShiftBy = atNthLnkOutShiftBy 0
atFstLnkOutShiftInward :: Float -> PlacementSpot
atFstLnkOutShiftInward x = atFstLnkOutShiftBy f
atFstLnkOutShiftInward = atNthLnkOutShiftInward 0
atNthLnkOutShiftInward ::Int -> Float -> PlacementSpot
atNthLnkOutShiftInward n x = atNthLnkOutShiftBy n f
where
f (p,a) = (p +.+ rotateV a (V2 0 (negate x)),a)