Skip to content

Commit

Permalink
updating changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
runemadsen committed Sep 28, 2017
1 parent cf3c39e commit a4346c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.1.1

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

## 1.1.0

Expand Down
22 changes: 18 additions & 4 deletions dist/rune.js
Original file line number Diff line number Diff line change
Expand Up @@ -2631,9 +2631,19 @@ var Parent = {
},

removeChild: function(child) {

if(child.parent !== this) {
return;
}

// check if it is in this parent
this.renderedChildren.splice(child.childId, 1);
this.children.splice(child.childId, 1);
this.changedChildren = without(this.changedChildren, child.childId);

var childIndex = this.changedChildren.indexOf(child.childId);
if(childIndex !== -1) {
this.changedChildren.splice(childIndex, 1);
}

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

if(attrs.width && attrs.height) {
attrs.viewBox = '0 0 ' + attrs.width + ' ' + attrs.height;
}

var props = {
attributes: attrs
attributes: attrs
}

this.tree = svg('svg', props);
this.el = createElement(this.tree);
this.stage = new Group();
Expand Down Expand Up @@ -3282,7 +3296,7 @@ Rune.prototype = {
var props = {
attributes: attrs
}

var newTree = svg('svg', props, [this.stage.renderChildren({ debug: this.debug })]);
var diffTree = diff(this.tree, newTree);
this.el = patch(this.el, diffTree);
Expand Down

0 comments on commit a4346c6

Please sign in to comment.