mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00

Right now, when updating the z-index of a node in a container, the indices of all its siblings are refreshed. However, if the node changes its z-index from z1 to z2, we only need to refresh the z-indexes of the node's parent's children in the closed range [ min(z1,z2), max(z1,z2) ]. For groups and layers with many children that will be more optimal in many cases. In addition to the above change, this patch: * forces the parameter of Node#setZIndex() to be in the valid range. * adds the (now absent) unit tests for the methods of Node that change z-indices of the parent's children.