MCPcopy
hub / github.com/adobe-webplatform/Snap.svg / GgetBBox

Function GgetBBox

demos/snap-ad/site/js/main.js:3271–3284  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3269 return this;
3270}
3271function GgetBBox() {
3272 if (this.type == "linearGradient") {
3273 var x1 = $(this.node, "x1") || 0,
3274 x2 = $(this.node, "x2") || 1,
3275 y1 = $(this.node, "y1") || 0,
3276 y2 = $(this.node, "y2") || 0;
3277 return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
3278 } else {
3279 var cx = this.node.cx || .5,
3280 cy = this.node.cy || .5,
3281 r = this.node.r || 0;
3282 return Snap._.box(cx - r, cy - r, r * 2, r * 2);
3283 }
3284}
3285function gradient(defs, str) {
3286 var grad = arrayFirstValue(eve("snap.util.grad.parse", null, str)),
3287 el;

Callers

nothing calls this directly

Calls 1

$Function · 0.70

Tested by

no test coverage detected