Skip to content

Commit a42b1e3

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents eb73c55 + 26f326e commit a42b1e3

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

examples/Scripts/Fitting.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<title>Example</title>
6+
<link rel="stylesheet" href="../css/style.css">
7+
<script type="text/javascript" src="../../dist/paper.js"></script>
8+
<script type="text/paperscript" canvas="canvas">
9+
var blackPath = new Path.Circle(new Point(), 10);
10+
blackPath.fillColor = 'black';
11+
12+
var redPath = new Path.Circle(new Point(), 10);
13+
redPath.fillColor = 'red';
14+
15+
function onResize() {
16+
// Whenever the view is resized:
17+
18+
// Fit the black path, so it covers the view:
19+
blackPath.fitBounds(view.bounds, true);
20+
21+
// Fit the red path, so it fits inside the view:
22+
redPath.fitBounds(view.bounds);
23+
}
24+
onResize();
25+
</script>
26+
</head>
27+
<body>
28+
<canvas id="canvas" resize keepalive="true"></canvas>
29+
</body>
30+
</html>

0 commit comments

Comments
 (0)