mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Merge remote branch 'origin/master'
This commit is contained in:
commit
d3e9a1152d
2 changed files with 8 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue