diff --git a/src/shapes/rect.class.js b/src/shapes/rect.class.js index 2de01269..aad24400 100644 --- a/src/shapes/rect.class.js +++ b/src/shapes/rect.class.js @@ -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);