MCPcopy Create free account
hub / github.com/microsoft/SandDance / collision

Function collision

docs/app/js/sanddance-app.js:138812–138815  ·  view source on GitHub ↗
($, x, y, textHeight, textWidth, h, bm0, bm1)

Source from the content-addressed store, hash-verified

138810 return x - r < 0 || x + r > width || y - (r = textHeight / 2) < 0 || y + r > height;
138811}
138812function collision($, x, y, textHeight, textWidth, h, bm0, bm1) {
138813 const w = textWidth * h / (textHeight * 2), x1 = $(x - w), x2 = $(x + w), y1 = $(y - (h = h / 2)), y2 = $(y + h);
138814 return bm0.outOfBounds(x1, y1, x2, y2) || bm0.getRange(x1, y1, x2, y2) || bm1 && bm1.getRange(x1, y1, x2, y2);
138815}
138816function placeAreaLabelReducedSearch($, bitmaps, avoidBaseMark, markIndex) {
138817 const width = $.width, height = $.height, bm0 = bitmaps[0], // where labels have been placed
138818 bm1 = bitmaps[1]; // area outlines

Callers 3

tryLabelFunction · 0.70
placeAreaLabelFloodFillFunction · 0.70

Calls 1

$Function · 0.70

Tested by

no test coverage detected