Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed Jun 9, 2023
1 parent 224bf0a commit 20e0d2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Swarm/TUI/Editor/Area.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ invertY (V2 x y) = V2 x (-y)

-- | Incorporates an offset by -1, since the area is
-- "inclusive" of the lower-right coordinate.
-- Inverse of "cornersToArea".
upperLeftToBottomRight :: AreaDimensions -> Location -> Location
upperLeftToBottomRight (AreaDimensions w h) upperLeft =
upperLeft .+^ displacement
Expand All @@ -31,6 +32,7 @@ upperLeftToBottomRight (AreaDimensions w h) upperLeft =
-- | Converts the displacement vector between the two
-- diagonal corners of the rectangle into an "AreaDimensions" record.
-- Adds one to both dimensions since the corner coordinates are "inclusive".
-- Inverse of "upperLeftToBottomRight".
cornersToArea :: Location -> Location -> AreaDimensions
cornersToArea upperLeft lowerRight =
AreaDimensions x y
Expand Down

0 comments on commit 20e0d2b

Please sign in to comment.