Results 1 to 5 of 5

Thread: TextMetrics in v4 ignores container styles

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9339 in a recent build.
  1. #1
    Sencha Premium Member Troy Wolf's Avatar
    Join Date
    May 2007
    Location
    Kansas City
    Posts
    251
    Vote Rating
    3
      0  

    Thumbs up TextMetrics in v4 ignores container styles

    I used jsfiddle to demonstrate the problem as simply as I can. Both create a new TextMetrics instance from a DIV that has a basic style applied. Then I get the width of a single space. Play with the font-size in the style then re-run the fiddle. See that the width returned by TextMetrics changes as the font-size changes. This is good.

    Ext3.4.0 Example -- things work
    http://jsfiddle.net/troywolf/ST3a4/

    Ext.4.2.0 Example -- things not workie
    http://jsfiddle.net/troywolf/C2Sjx/

    Also, notice that the method to instantiate the TextMetrics object changed from 3 to 4. To make my custom component work in both 3 and 4, I have to test which Ext version is loaded then create the instance accordingly.

    *edit from SLEMMON
    Upon testing I'm seeing that a "&#160" space character is reported with a width of 3 pixels from 3.4 and as 4 pixels from 4.2 and using the dev tools in Chrome the element does appear to be 4px.
    4.2 test case demonstrated:
    http://jsfiddle.net/C2Sjx/1/
    3.4 test case demonstrated:
    http://jsfiddle.net/ST3a4/3/
    Last edited by slemmon; 3 Apr 2013 at 2:50 PM. Reason: added additional test case notes

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    Do you think it can be a bug? In other words, does it work differently from as it is documented?

    If so, the best would be if I move this thread to bugs so that the developers can look into it.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  3. #3
    Sencha Premium Member Troy Wolf's Avatar
    Join Date
    May 2007
    Location
    Kansas City
    Posts
    251
    Vote Rating
    3
      0  

    Thumbs up Bug? Not my call.

    Quote Originally Posted by jsakalos View Post
    Do you think it can be a bug? In other words, does it work differently from as it is documented?

    If so, the best would be if I move this thread to bugs so that the developers can look into it.
    Thank you for the reply.

    I always take the humble approach that I have misunderstood the product rather than assume a bug. I've been doing this for over 20 years--there have been way too many times I was sure the issue was due to a bug only to discover I needed to RTFM.

    I don't have the power to move a thread, so let's hope someone with authority will see this thread, look at my super-simple examples, determine if it is indeed a bug, and move this thread accordingly.

  4. #4
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    OK, moving the thread to Bugs.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  5. #5
    Sencha - Documentation Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,162
    Vote Rating
    257
      0  

    Default

    I'm good calling this one a bug. For " " I'm getting a 3 pixel width reported from 3.4 and a 4 pixel width reported from 4.2 and when I use the dev tools in Chrome to get the width of the element it does report as 4px, not 3.

    *I modified the examples just slightly and am editing your initial post slightly to include that detail before submitting as a bug.

    Thanks for the report!

Tags for this Thread

Posting Permissions

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