mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
da5a837da2
6 changed files with 7 additions and 10 deletions
|
@ -45,8 +45,6 @@
|
|||
}
|
||||
});
|
||||
|
||||
onResize();
|
||||
|
||||
function createPath(strength) {
|
||||
var path = new Path();
|
||||
path.data = {};
|
||||
|
|
|
@ -77,9 +77,6 @@ function onResize(event) {
|
|||
var path = new Path.Rectangle(view.bounds);
|
||||
path.fillColor = raster.getAverageColor(path);
|
||||
}
|
||||
|
||||
// Call onResize directly:
|
||||
onResize();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
// Fit the red path, so it fits inside the view:
|
||||
redPath.fitBounds(view.bounds);
|
||||
}
|
||||
onResize();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -33,9 +33,6 @@
|
|||
handleTexts.push(handleOutText);
|
||||
}
|
||||
|
||||
// Call onResize directly on execution to correctly position everything
|
||||
onResize();
|
||||
|
||||
function onResize() {
|
||||
var width = view.size.width;
|
||||
var offset = width / 30;
|
||||
|
|
|
@ -189,6 +189,12 @@ var PaperScript = this.PaperScript = new function() {
|
|||
}
|
||||
if (view) {
|
||||
view.setOnResize(onResize);
|
||||
// Fire resize event directly, so any user
|
||||
// defined resize handlers are called.
|
||||
view.fire('resize', {
|
||||
size: view.size,
|
||||
delta: new Point()
|
||||
});
|
||||
view.setOnFrame(onFrame);
|
||||
// Automatically draw view at the end.
|
||||
view.draw();
|
||||
|
|
|
@ -43,7 +43,7 @@ var PathItem = this.PathItem = Item.extend(/** @lends PathItem# */{
|
|||
* path.strokeColor = 'black';
|
||||
*
|
||||
* // Select the path, so we can see its handles:
|
||||
* path.selected = true;
|
||||
* path.fullySelected = true;
|
||||
*
|
||||
* // Create a copy of the path and move it 100pt to the right:
|
||||
* var copy = path.clone();
|
||||
|
|
Loading…
Reference in a new issue