Skip to content

Commit

Permalink
Change view to rectEnvelope.
Browse files Browse the repository at this point in the history
To clean up the space for lens. I don't view was a great description of
the function anyway.
  • Loading branch information
cchalmers committed Mar 9, 2015
1 parent 88ffd9d commit aa321bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Diagrams/TwoD.hs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ module Diagrams.TwoD

, extrudeLeft, extrudeRight, extrudeBottom, extrudeTop

, view
, rectEnvelope

-- ** Background

Expand Down
8 changes: 4 additions & 4 deletions src/Diagrams/TwoD/Combinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module Diagrams.TwoD.Combinators

, extrudeLeft, extrudeRight, extrudeBottom, extrudeTop

, view
, rectEnvelope

, boundingRect, bg, bgFrame

Expand Down Expand Up @@ -235,14 +235,14 @@ extrudeTop s
| s >= 0 = extrudeEnvelope $ unitY ^* s
| otherwise = intrudeEnvelope $ unitY ^* s

-- | @view p v@ sets the envelope of a diagram to a rectangle whose
-- | @boxEnvelope p v@ sets the envelope of a diagram to a rectangle whose

This comment has been minimized.

Copy link
@byorgey

byorgey Mar 11, 2015

Member

s/boxEnvelope/rectEnvelope/

-- lower-left corner is at @p@ and whose upper-right corner is at @p
-- .+^ v@. Useful for selecting the rectangular portion of a
-- diagram which should actually be \"viewed\" in the final render,
-- if you don't want to see the entire diagram.
view :: forall b n m. (OrderedField n, Monoid' m)
rectEnvelope :: forall b n m. (OrderedField n, Monoid' m)
=> Point V2 n -> V2 n -> QDiagram b V2 n m -> QDiagram b V2 n m
view p (V2 w h) = withEnvelope (rect w h # alignBL # moveTo p :: Path V2 n)
rectEnvelope p (V2 w h) = withEnvelope (rect w h # alignBL # moveTo p :: Path V2 n)

-- | Construct a bounding rectangle for an enveloped object, that is,
-- the smallest axis-aligned rectangle which encloses the object.
Expand Down

0 comments on commit aa321bc

Please sign in to comment.