From c5bf683d6351d885d7e5ed07f667df5d8625a491 Mon Sep 17 00:00:00 2001 From: kangax Date: Tue, 15 May 2012 18:01:57 +0400 Subject: [PATCH] Display circle as rotating control, rather than square. --- src/object.class.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/object.class.js b/src/object.class.js index def365df..78ac1a6c 100644 --- a/src/object.class.js +++ b/src/object.class.js @@ -679,12 +679,16 @@ _left = left - scaleOffsetX; _top = top + height/2 - scaleOffsetY; ctx.fillRect(_left, _top, sizeX, sizeY); - + // middle-top-rotate if (this.hasRotatingPoint) { - _left = left + this.width/2 - scaleOffsetX; - _top = top - (45 / this.scaleY); - ctx.fillRect(_left, _top, sizeX, sizeY); + _left = left + this.width/2; + _top = top - (45 / this.scaleY) + scaleOffsetY; + ctx.save(); + ctx.beginPath(); + ctx.arc(_left, _top, sizeX / 2, 0, Math.PI * 2, false); + ctx.fill(); + ctx.restore(); } ctx.restore();