Update rect.class.js

This commit is contained in:
Andrea Bogazzi 2014-09-02 22:40:49 +02:00
parent d87af17aa4
commit 55f9a5947b

View file

@ -98,17 +98,13 @@
ry = this.ry ? Math.min(this.ry, this.height / 2) : 0,
w = this.width,
h = this.height,
x = noTransform ? this.left : 0,
y = noTransform ? this.top : 0,
x = noTransform ? this.left : -this.width / 2,
y = noTransform ? this.top : -this.height / 2,
isRounded = rx !== 0 || ry !== 0,
k = 1 - 0.5522847498 /* "magic number" for bezier approximations of arcs (http://itc.ktu.lt/itc354/Riskus354.pdf) */;
ctx.beginPath();
if (!noTransform) {
ctx.translate(-this.width / 2, -this.height / 2);
}
ctx.moveTo(x + rx, y);
ctx.lineTo(x + w - rx, y);