MCPcopy
hub / github.com/tdewolff/minify / isTwoLabelOverlapped

Function isTwoLabelOverlapped

_benchmarks/sample_echarts.js:47310–47326  ·  view source on GitHub ↗
(current, next)

Source from the content-addressed store, hash-verified

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';

Callers 1

fixMinMaxLabelShowFunction · 0.85

Calls 3

mul$1Function · 0.85
identityFunction · 0.70
rotateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…