KineticJS icon indicating copy to clipboard operation
KineticJS copied to clipboard

Inconsisten application of scale for circle

Open AlvinPLeung opened this issue 12 years ago • 7 comments

The x, y of a circle is not scaled correctly. http://jsfiddle.net/eL2rr/

AlvinPLeung avatar Apr 08 '14 22:04 AlvinPLeung

What is not correct? What are you expecting?

lavrton avatar Apr 09 '14 01:04 lavrton

You can adjust the offset. I think what you're going for is this:

http://jsfiddle.net/eL2rr/2/

On Tue, Apr 8, 2014 at 6:35 PM, AlvinPLeung [email protected]:

The x, y of a circle is not scaled correctly. http://jsfiddle.net/eL2rr/

Reply to this email directly or view it on GitHubhttps://github.com/ericdrowell/KineticJS/issues/886 .

jfollas avatar Apr 09 '14 02:04 jfollas

I expect the two objects with same scale factor on the same layer to retain their relative position.

Alvin

On Apr 8, 2014, at 6:25 PM, Anton Lavrenov [email protected] wrote:

What is not correct? What are you expecting?

— Reply to this email directly or view it on GitHub.

AlvinPLeung avatar Apr 09 '14 06:04 AlvinPLeung

Just need to multiply x and y position of the circle by the scale factor, then the position of the two objects will line up. At this moment, the line object behave like the entire layer is scaled. Only radius of the circle object is scaled.

Alvin

On Apr 8, 2014, at 7:09 PM, jfollas [email protected] wrote:

You can adjust the offset. I think what you're going for is this:

http://jsfiddle.net/eL2rr/2/

On Tue, Apr 8, 2014 at 6:35 PM, AlvinPLeung [email protected]:

The x, y of a circle is not scaled correctly. http://jsfiddle.net/eL2rr/

Reply to this email directly or view it on GitHubhttps://github.com/ericdrowell/KineticJS/issues/886 .

— Reply to this email directly or view it on GitHub.

AlvinPLeung avatar Apr 09 '14 06:04 AlvinPLeung

By design scaling don't affect x and y properties, only "size" properties - like width, height. Green line is moved because scale affect points property like size properties.

lavrton avatar Apr 09 '14 06:04 lavrton

Is this what you want? http://jsfiddle.net/eL2rr/1/ I set the x and y to the same value for each object. Then I needed to adjust the points so instead of being absolute on the canvas they were relative to the x, y of the line.

ippo615 avatar Apr 09 '14 12:04 ippo615

Sorry. I thought layer and group inherit container they should behave the same. Please close the ticket.

Alvin

On Wed, Apr 9, 2014 at 5:54 AM, Andrew Ippoliti [email protected]:

Is this what you want? http://jsfiddle.net/eL2rr/1/ I set the x and y to the same value for each object. Then I needed to adjust the points so instead of being absolute on the canvas they were relative to the x, y of the line.

Reply to this email directly or view it on GitHubhttps://github.com/ericdrowell/KineticJS/issues/886#issuecomment-39960032 .

AlvinPLeung avatar Apr 09 '14 17:04 AlvinPLeung