(current, next)
| 47308 | } |
| 47309 | |
| 47310 | function isTwoLabelOverlapped(current, next) { |
| 47311 | // current and next has the same rotation. |
| 47312 | var firstRect = current && current.getBoundingRect().clone(); |
| 47313 | var nextRect = next && next.getBoundingRect().clone(); |
| 47314 | |
| 47315 | if (!firstRect || !nextRect) { |
| 47316 | return; |
| 47317 | } // When checking intersect of two rotated labels, we use mRotationBack |
| 47318 | // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`. |
| 47319 | |
| 47320 | |
| 47321 | var mRotationBack = identity([]); |
| 47322 | rotate(mRotationBack, mRotationBack, -current.rotation); |
| 47323 | firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform())); |
| 47324 | nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform())); |
| 47325 | return firstRect.intersect(nextRect); |
| 47326 | } |
| 47327 | |
| 47328 | function isNameLocationCenter(nameLocation) { |
| 47329 | return nameLocation === 'middle' || nameLocation === 'center'; |
no test coverage detected
searching dependent graphs…