Skip to content
This repository
Browse code

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 1 changed file with 11 additions and 1 deletion. Show diff stats Hide diff stats

  1. +11 1 Graphics/Implicit/ObjectUtil/GetBox2.hs
12 Graphics/Implicit/ObjectUtil/GetBox2.hs
@@ -57,7 +57,17 @@ getBox2 (DifferenceR2 r symbObjs) =
57 57 firstBox
58 58
59 59 getBox2 (IntersectR2 r symbObjs) =
60   - outsetBox r $ unionBoxes (map getBox2 symbObjs)
  60 + let
  61 + boxes = map getBox2 symbObjs
  62 + (leftbot, topright) = unzip boxes
  63 + (lefts, bots) = unzip leftbot
  64 + (rights, tops) = unzip topright
  65 + left = maximum lefts
  66 + bot = maximum bots
  67 + right = minimum rights
  68 + top = minimum tops
  69 + in
  70 + ((left-r,bot-r),(right+r,top+r))
61 71
62 72 -- Simple transforms
63 73 getBox2 (Translate2 v symbObj) =

0 comments on commit 8a4eacd

Please sign in to comment.
Something went wrong with that request. Please try again.