Skip to content

Commit a4346c6

Browse files
committed
updating changelog
1 parent cf3c39e commit a4346c6

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 1.1.1
22

33
- Calling `remove` on a group with a shape that is not in the group will not remove another shape in the group.
4+
- Adding `viewBox` attribute on resulting SVG.
45

56
## 1.1.0
67

dist/rune.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2631,9 +2631,19 @@ var Parent = {
26312631
},
26322632

26332633
removeChild: function(child) {
2634+
2635+
if(child.parent !== this) {
2636+
return;
2637+
}
2638+
2639+
// check if it is in this parent
26342640
this.renderedChildren.splice(child.childId, 1);
26352641
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+
}
26372647

26382648
// Lower id's of all children above by one
26392649
for(var i = child.childId; i < this.children.length; i++) {
@@ -3079,10 +3089,14 @@ var Rune = function(options) {
30793089
this.height = params.height;
30803090
}
30813091

3092+
if(attrs.width && attrs.height) {
3093+
attrs.viewBox = '0 0 ' + attrs.width + ' ' + attrs.height;
3094+
}
3095+
30823096
var props = {
3083-
attributes: attrs
3097+
attributes: attrs
30843098
}
3085-
3099+
30863100
this.tree = svg('svg', props);
30873101
this.el = createElement(this.tree);
30883102
this.stage = new Group();
@@ -3282,7 +3296,7 @@ Rune.prototype = {
32823296
var props = {
32833297
attributes: attrs
32843298
}
3285-
3299+
32863300
var newTree = svg('svg', props, [this.stage.renderChildren({ debug: this.debug })]);
32873301
var diffTree = diff(this.tree, newTree);
32883302
this.el = patch(this.el, diffTree);

0 commit comments

Comments
 (0)