mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Update SpiralRaster example.
This commit is contained in:
parent
676a207871
commit
2b4a1a7dc4
1 changed files with 12 additions and 11 deletions
|
@ -14,12 +14,13 @@
|
||||||
var raster = new Raster('mona');
|
var raster = new Raster('mona');
|
||||||
raster.remove();
|
raster.remove();
|
||||||
|
|
||||||
var text = new PointText(view.bounds.bottomRight - [30, 30]);
|
var text = new PointText({
|
||||||
text.justification = 'right';
|
justification: 'right',
|
||||||
text.fontSize = 12;
|
fontSize: 12,
|
||||||
text.content = window.FileReader
|
content: window.FileReader
|
||||||
? 'drag & drop an image from your desktop to rasterize it'
|
? 'drag & drop an image from your desktop to rasterize it'
|
||||||
: 'to drag & drop images, please use Webkit, Firefox, Chrome or IE 10';
|
: 'to drag & drop images, please use Webkit, Firefox, Chrome or IE 10'
|
||||||
|
});
|
||||||
|
|
||||||
resetSpiral();
|
resetSpiral();
|
||||||
|
|
||||||
|
@ -62,18 +63,18 @@
|
||||||
|
|
||||||
position = view.center;
|
position = view.center;
|
||||||
count = 0;
|
count = 0;
|
||||||
path = new Path();
|
path = new Path({
|
||||||
path.fillColor = 'black';
|
fillColor: 'black',
|
||||||
path.closed = true;
|
closed: true
|
||||||
|
});
|
||||||
|
|
||||||
position = view.center;
|
position = view.center;
|
||||||
max = Math.min(raster.bounds.width, raster.bounds.height) * 0.5;
|
max = Math.min(raster.bounds.width, raster.bounds.height) * 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onResize() {
|
function onResize() {
|
||||||
text.remove();
|
resetSpiral();
|
||||||
if (count > 0)
|
text.point = view.bounds.bottomRight - [30, 30];
|
||||||
resetSpiral();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onKeyDown(event) {
|
function onKeyDown(event) {
|
||||||
|
|
Loading…
Reference in a new issue