MCPcopy Create free account
hub / github.com/CoderOpen/waimai / avoidCollision

Function avoidCollision

front/components/u-charts/u-charts.js:286–304  ·  view source on GitHub ↗
(obj, target)

Source from the content-addressed store, hash-verified

284}
285
286function avoidCollision(obj, target) {
287 if (target) {
288 // is collision test
289 while (util.isCollision(obj, target)) {
290 if (obj.start.x > 0) {
291 obj.start.y--;
292 } else if (obj.start.x < 0) {
293 obj.start.y++;
294 } else {
295 if (obj.start.y > 0) {
296 obj.start.y++;
297 } else {
298 obj.start.y--;
299 }
300 }
301 }
302 }
303 return obj;
304}
305
306function fillSeries(series, opts, config) {
307 var index = 0;

Callers 1

drawPieTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected