You found a bug! We've classified it as EXTJS-7954 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    11
    Vote Rating
    0
    djohnanderson is on a distinguished road

      0  

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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,074
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


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

Thread Participants: 1