Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

GetBox2: Revert previous mistake in refactor of Intersect2

I misread this code to be a union. It clearly is not.
  • Loading branch information...
commit 8a4eacde086eb9dec8d4d9c39f6baef5b4344e5b 1 parent 11855f3
Ben Gamari bgamari authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 Graphics/Implicit/ObjectUtil/GetBox2.hs
12 Graphics/Implicit/ObjectUtil/GetBox2.hs
View
@@ -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) =
Please sign in to comment.
Something went wrong with that request. Please try again.