Results 1 to 2 of 2

Thread: applyZIndex in Ext.draw.engine.Svg should reorder the sprite in items mixedCollection

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    12
    Vote Rating
    0
      0  

    Default applyZIndex in Ext.draw.engine.Svg should reorder the sprite in items mixedCollection

    ersion ExtJS 4.1.1a


    Sprites are kept sorted in zIndex in the items mixedCollection to allow binary search to find the items more quickly. If you change the zIndex of a sprite, applyZIndex in Ext.draw.engine.Svg is called which inserts the sprites element into the dom in sorted order.


    However applyZIndex doesn't move the sprite in the items mixed collection to keep it sorted, which causes failures in subsequent binary searches.


    So the fix is to make sure the mixed collection stays sorted when changing the zIndex of a sprite. Here's the code that fixes the bug:


    Ext.override(Ext.draw.engine.Svg, {
    applyZIndex: function(sprite) {
    /* Bug fix:
    * applyZIndex doesn't reorder the sprites in the items mixedCollection.
    * This causes the sprites to be sorted incorrectly.
    */
    this.items.remove(sprite);
    this.insertByZIndex(sprite);
    this.callOverridden(arguments);
    }
    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,336
    Vote Rating
    1296
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Posting Permissions

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