Merge remote branch 'origin/master'

This commit is contained in:
Jonathan Puckey 2011-05-11 22:46:53 +02:00
commit d3e9a1152d
2 changed files with 8 additions and 4 deletions

View file

@ -35,10 +35,14 @@ var Document = this.Document = Base.extend({
this.canvas.width = this._size.width;
this.canvas.height = this._size.height;
var that = this;
var offset = DomElement.getOffset(this.canvas);
DomEvent.add(window, {
resize: function(event) {
that.setSize(DomElement.getWindowSize()
.subtract(DomElement.getOffset(that.canvas)));
// Only get canvas offset if it's not invisible (size is
// 0, 0), as otherwise the offset would be wrong.
if (!DomElement.getSize(that.canvas).equals([0, 0]))
offset = DomElement.getOffset(that.canvas);
that.setSize(DomElement.getWindowSize().subtract(offset));
that.redraw();
}
});

View file

@ -158,8 +158,8 @@ var ToolEvent = this.ToolEvent = Base.extend({
// Return downCount for both mouse down and up, since
// the count is the same.
return /^mouse(down|up)$/.test(this.type)
? this.tool.downCount
: this.tool.count;
? this.tool.downCount
: this.tool.count;
},
setCount: function(count) {