Permalink
Browse files

Merge pull request #81 from bgamari/fixes

GetBox2: Revert previous mistake in refactor of Intersect2
  • Loading branch information...
2 parents c0d7b41 + 8a4eacd commit 3df20b277f03488ba1cb1a4f9245d03f38dae0ab @colah committed Dec 2, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 Graphics/Implicit/ObjectUtil/GetBox2.hs
View
12 Graphics/Implicit/ObjectUtil/GetBox2.hs
@@ -57,7 +57,17 @@ getBox2 (DifferenceR2 r symbObjs) =
firstBox
getBox2 (IntersectR2 r symbObjs) =
- outsetBox r $ unionBoxes (map getBox2 symbObjs)
+ let
+ boxes = map getBox2 symbObjs
+ (leftbot, topright) = unzip boxes
+ (lefts, bots) = unzip leftbot
+ (rights, tops) = unzip topright
+ left = maximum lefts
+ bot = maximum bots
+ right = minimum rights
+ top = minimum tops
+ in
+ ((left-r,bot-r),(right+r,top+r))
-- Simple transforms
getBox2 (Translate2 v symbObj) =

0 comments on commit 3df20b2

Please sign in to comment.