2011-06-19 10:45:29 -04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
2011-06-30 09:57:17 -04:00
|
|
|
<title>Fitting</title>
|
2011-06-19 10:45:29 -04:00
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
|
|
<script type="text/javascript" src="../../dist/paper.js"></script>
|
|
|
|
<script type="text/paperscript" canvas="canvas">
|
|
|
|
var blackPath = new Path.Circle(new Point(), 10);
|
|
|
|
blackPath.fillColor = 'black';
|
|
|
|
|
|
|
|
var redPath = new Path.Circle(new Point(), 10);
|
|
|
|
redPath.fillColor = 'red';
|
2011-07-07 10:09:02 -04:00
|
|
|
|
2011-06-19 10:45:29 -04:00
|
|
|
function onResize() {
|
|
|
|
// Whenever the view is resized:
|
|
|
|
|
|
|
|
// Fit the black path, so it covers the view:
|
|
|
|
blackPath.fitBounds(view.bounds, true);
|
2011-07-07 10:09:02 -04:00
|
|
|
|
2011-06-19 10:45:29 -04:00
|
|
|
// Fit the red path, so it fits inside the view:
|
|
|
|
redPath.fitBounds(view.bounds);
|
|
|
|
}
|
|
|
|
onResize();
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2011-06-29 07:44:06 -04:00
|
|
|
<canvas id="canvas" resize></canvas>
|
2011-06-19 10:45:29 -04:00
|
|
|
</body>
|
|
|
|
</html>
|