File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments