Clean up white spaces.

This commit is contained in:
Jürg Lehni 2011-07-07 16:09:02 +02:00
parent e573fe5dcd
commit 5655981f6d
34 changed files with 147 additions and 148 deletions

View file

@ -50,7 +50,7 @@
this.vector.x *= 0.99;
var pre = this.point + this.vector;
if (pre.x < this.radius || pre.x > size.width - this.radius)
this.vector.x *= -this.dampen;
this.vector.x *= -this.dampen;
if (pre.y < this.radius || pre.y > size.height - this.radius) {
if (Math.abs(this.vector.x) < 3)
this.vector = Point.random() * [150, 100] + [-75, 20];

View file

@ -11,13 +11,13 @@
var redPath = new Path.Circle(new Point(), 10);
redPath.fillColor = 'red';
function onResize() {
// Whenever the view is resized:
// Fit the black path, so it covers the view:
blackPath.fitBounds(view.bounds, true);
// Fit the red path, so it fits inside the view:
redPath.fitBounds(view.bounds);
}

View file

@ -7,33 +7,33 @@
<script type="text/javascript" src="../../dist/paper.js"></script>
<script type="text/paperscript" canvas="canvas">
var center = view.center;
var path,
h,
s = 0.6,
h,
s = 0.6,
l = 0.6,
d = view.size.width * 0.012;
p = new Point(),
p = new Point(),
r = view.size.width * .12;
for (s = 0; s <= 1; s+=0.2) {
for (h = 0; h < (s > 0 ? 360 : 1); h+= 20) {
p.x = (center.x - r)*0.5 + Math.cos((h-90)/180*Math.PI) * r*s;
p.y = center.y + Math.sin((h-90)/180*Math.PI) * r*s;
path = new Path.Circle(p, Math.max(d*Math.sqrt(s), 5));
path.fillColor = new HSLColor(h, s, 0.75);
p.x = center.x + Math.cos((h-90)/180*Math.PI) * r*s;
p.y = center.y + Math.sin((h-90)/180*Math.PI) * r*s;
path = new Path.Circle(p, Math.max(d*Math.sqrt(s), 5));
path.fillColor = new HSLColor(h, s, 0.5);
p.x = center.x + (center.x + r) * .5 + Math.cos((h-90)/180*Math.PI) * r*s;
p.y = center.y + Math.sin((h-90)/180*Math.PI) * r*s;
path = new Path.Circle(p, Math.max(d*Math.sqrt(s), 5));
path.fillColor = new HSLColor(h, s, 0.25);
}
}
}
</script>
</head>
<body>

View file

@ -9,7 +9,7 @@
var path;
var rect = new Rectangle([150, 150], [300, 300]);
project.currentStyle.fillColor = 'black';
function onFrame(event) {
if (path)
path.remove();

View file

@ -84,7 +84,7 @@
rect.strokeColor = 'green';
rect.fillColor = null;
}
project.activeLayer.position = view.center;
</script>
</head>