Results 1 to 3 of 3

Thread: [4.1.1 RC2] Sprite's el getHeight() returns 0

  1. #1
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Vote Rating
    253
      0  

    Default [4.1.1 RC2] Sprite's el getHeight() returns 0

    I'm testing 4.1.1 RC2 in Chrome and have a sprite that I'm trying to get the height of. Sprite.el.getWidth() works as expected. Sprite.el.getHeight() returns 0.

    Get NaN in Firefox. Again, width is ok

  2. #2
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,968
    Vote Rating
    931
      0  

    Default

    The same happens in 4.0.x, you should use the getBBox() method.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Vote Rating
    253
      0  

    Default

    The height/width being off from the pixels threw me. Used the surface's viewBoxShift.scale to adjust for it and was having a hard time finding the surface's left/top edge. Found I could use surface.bgRect.getX() and getY() and everything lines up perfect.

    Any idea if surface.bgRect could be declared a public property in the API?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •