KineticJS icon indicating copy to clipboard operation
KineticJS copied to clipboard

[feature] getBoundingClientRect for any node

Open lavrton opened this issue 11 years ago • 1 comments

Hi, guys. I am thinking about adding new method getBoundingClientRect that will return object with x, y, width and height properties. Also the method will take into account:

  1. offset
  2. shadow
  3. stroke
  4. scale
  5. group

That will allow us:

  1. easy getting width and height values for groups
  2. much better default caching behaviour
  3. One way to detect position and size of nodes. (for example {x,y} of circle is center, but {x,y} of rect is top left point)
  4. more...

Any thoughts?

lavrton avatar Apr 22 '14 08:04 lavrton

really great idea ! I had to deal with such a case in one of my projects. If you implement it, I will try it immediatly.

pfautrero avatar Jul 21 '14 12:07 pfautrero