mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-16 16:09:33 -04:00
Implement non-scaling strokes through Style#strokeScaling.
Closes #418.
This commit is contained in:
parent
68db4f9b59
commit
846c806034
12 changed files with 277 additions and 126 deletions
examples/JSON
|
@ -6,24 +6,39 @@
|
|||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var ellipse = new Shape.Ellipse({
|
||||
from: [10, 10],
|
||||
to: [200, 100],
|
||||
var circle = new Shape.Circle({
|
||||
center: [100, 100],
|
||||
radius: 50,
|
||||
fillColor: 'red'
|
||||
});
|
||||
|
||||
var circle = new Shape.Circle({
|
||||
center: [50, 150],
|
||||
radius: 25,
|
||||
fillColor: 'blue'
|
||||
var ellipse = new Shape.Ellipse({
|
||||
center: [100, 200],
|
||||
radius: [50, 25],
|
||||
fillColor: 'blue',
|
||||
strokeColor: 'black',
|
||||
strokeWidth: 4,
|
||||
rotation: 20
|
||||
});
|
||||
|
||||
var rectangle = new Shape.Rectangle({
|
||||
from: [25, 200],
|
||||
to: [100, 225],
|
||||
fillColor: 'green'
|
||||
var rect = new Shape.Rectangle({
|
||||
center: [100, 300],
|
||||
size: [100, 50],
|
||||
fillColor: 'green',
|
||||
strokeColor: 'black',
|
||||
strokeWidth: 4,
|
||||
rotation: -20
|
||||
});
|
||||
|
||||
var roundRect = new Shape.Rectangle({
|
||||
center: [100, 400],
|
||||
size: [50, 100],
|
||||
radius: [15, 20],
|
||||
fillColor: 'orange',
|
||||
strokeColor: 'black',
|
||||
strokeWidth: 4,
|
||||
rotation: 20
|
||||
});
|
||||
rectangle.rotate(30);
|
||||
|
||||
window._json = project.exportJSON();
|
||||
console.log(window._json);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue