| 91 | cornerRadii[id] || { tl: globalRadius, tr: globalRadius, br: globalRadius, bl: globalRadius }; |
| 92 | |
| 93 | export const computeShapesBBox = shapes => { |
| 94 | let minX = Infinity, |
| 95 | minY = Infinity, |
| 96 | maxX = -Infinity, |
| 97 | maxY = -Infinity; |
| 98 | shapes.forEach(s => { |
| 99 | minX = Math.min(minX, s.x); |
| 100 | minY = Math.min(minY, s.y); |
| 101 | maxX = Math.max(maxX, s.x + s.w); |
| 102 | maxY = Math.max(maxY, s.y + s.h); |
| 103 | }); |
| 104 | return { x: minX, y: minY, w: maxX - minX, h: maxY - minY }; |
| 105 | }; |
| 106 | |
| 107 | // How much extra room the shadow / stroke effects need outside the shape bounds. |
| 108 | export const effectPadding = style => { |
no outgoing calls
no test coverage detected