(current, next, labelLayout)
| 40825 | } |
| 40826 | |
| 40827 | function isTwoLabelOverlapped(current, next, labelLayout) { |
| 40828 | // current and next has the same rotation. |
| 40829 | var firstRect = current && current.getBoundingRect().clone(); |
| 40830 | var nextRect = next && next.getBoundingRect().clone(); |
| 40831 | |
| 40832 | if (!firstRect || !nextRect) { |
| 40833 | return; |
| 40834 | } |
| 40835 | |
| 40836 | // When checking intersect of two rotated labels, we use mRotationBack |
| 40837 | // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`. |
| 40838 | var mRotationBack = identity([]); |
| 40839 | rotate(mRotationBack, mRotationBack, -current.rotation); |
| 40840 | |
| 40841 | firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform())); |
| 40842 | nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform())); |
| 40843 | |
| 40844 | return firstRect.intersect(nextRect); |
| 40845 | } |
| 40846 | |
| 40847 | function isNameLocationCenter(nameLocation) { |
| 40848 | return nameLocation === 'middle' || nameLocation === 'center'; |
no test coverage detected