@@ -1206,7 +1206,7 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
12061206 */
12071207 insertChild : function ( index , item ) {
12081208 if ( this . _children ) {
1209- item . _remove ( false , true ) ;
1209+ item . _remove ( true ) ;
12101210 Base . splice ( this . _children , [ item ] , index , 0 ) ;
12111211 item . _parent = this ;
12121212 item . _setProject ( this . _project ) ;
@@ -1353,10 +1353,8 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
13531353 /**
13541354 * Removes the item from its parent's children list.
13551355 */
1356- _remove : function ( deselect , notify ) {
1356+ _remove : function ( notify ) {
13571357 if ( this . _parent ) {
1358- if ( deselect )
1359- this . setSelected ( false ) ;
13601358 if ( this . _name )
13611359 this . _removeFromNamed ( ) ;
13621360 if ( this . _index != null )
@@ -1377,7 +1375,7 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
13771375 * @return {Boolean } {@true the item was removed }
13781376 */
13791377 remove : function ( ) {
1380- return this . _remove ( true , true ) ;
1378+ return this . _remove ( true ) ;
13811379 } ,
13821380
13831381 /**
@@ -1407,7 +1405,7 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
14071405 // fine, since it only calls Base.splice() if #_index is set.
14081406 var removed = Base . splice ( this . _children , null , from , to - from ) ;
14091407 for ( var i = removed . length - 1 ; i >= 0 ; i -- )
1410- removed [ i ] . _remove ( true , false ) ;
1408+ removed [ i ] . _remove ( false ) ;
14111409 if ( removed . length > 0 )
14121410 this . _changed ( /*#=*/ Change . HIERARCHY ) ;
14131411 return removed ;
@@ -2493,6 +2491,11 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
24932491 draw : function ( item , ctx , param ) {
24942492 if ( ! item . _visible || item . _opacity == 0 )
24952493 return ;
2494+ // Each time the project gets drawn, it's _drawCount is increased.
2495+ // Keep the _drawCount of drawn items in sync, so we have an easy
2496+ // way to filter out selected items that are not being drawn, e.g.
2497+ // because they are currently not part of the DOM.
2498+ item . _drawCount = item . _project . _drawCount ;
24962499 var tempCanvas , parentCtx ,
24972500 itemOffset , prevOffset ;
24982501 // If the item has a blendMode or is defining an opacity, draw it on
0 commit comments