@@ -2631,9 +2631,19 @@ var Parent = {
2631
2631
} ,
2632
2632
2633
2633
removeChild : function ( child ) {
2634
+
2635
+ if ( child . parent !== this ) {
2636
+ return ;
2637
+ }
2638
+
2639
+ // check if it is in this parent
2634
2640
this . renderedChildren . splice ( child . childId , 1 ) ;
2635
2641
this . children . splice ( child . childId , 1 ) ;
2636
- this . changedChildren = without ( this . changedChildren , child . childId ) ;
2642
+
2643
+ var childIndex = this . changedChildren . indexOf ( child . childId ) ;
2644
+ if ( childIndex !== - 1 ) {
2645
+ this . changedChildren . splice ( childIndex , 1 ) ;
2646
+ }
2637
2647
2638
2648
// Lower id's of all children above by one
2639
2649
for ( var i = child . childId ; i < this . children . length ; i ++ ) {
@@ -3079,10 +3089,14 @@ var Rune = function(options) {
3079
3089
this . height = params . height ;
3080
3090
}
3081
3091
3092
+ if ( attrs . width && attrs . height ) {
3093
+ attrs . viewBox = '0 0 ' + attrs . width + ' ' + attrs . height ;
3094
+ }
3095
+
3082
3096
var props = {
3083
- attributes : attrs
3097
+ attributes : attrs
3084
3098
}
3085
-
3099
+
3086
3100
this . tree = svg ( 'svg' , props ) ;
3087
3101
this . el = createElement ( this . tree ) ;
3088
3102
this . stage = new Group ( ) ;
@@ -3282,7 +3296,7 @@ Rune.prototype = {
3282
3296
var props = {
3283
3297
attributes : attrs
3284
3298
}
3285
-
3299
+
3286
3300
var newTree = svg ( 'svg' , props , [ this . stage . renderChildren ( { debug : this . debug } ) ] ) ;
3287
3301
var diffTree = diff ( this . tree , newTree ) ;
3288
3302
this . el = patch ( this . el , diffTree ) ;
0 commit comments