mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e9881c02fc
24 changed files with 27 additions and 8 deletions
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var doc;
|
var doc;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var doc;
|
var doc;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var doc;
|
var doc;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var doc;
|
var doc;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
|
|
@ -540,8 +540,7 @@ var Item = Base.extend({
|
||||||
// question for now.
|
// question for now.
|
||||||
if (!resolution)
|
if (!resolution)
|
||||||
resolution = 72;
|
resolution = 72;
|
||||||
// TODO: use strokebounds for this:
|
var bounds = this.strokeBounds;
|
||||||
var bounds = this.bounds;
|
|
||||||
var scale = resolution / 72;
|
var scale = resolution / 72;
|
||||||
var canvas = CanvasProvider.getCanvas(bounds.size.multiply(scale));
|
var canvas = CanvasProvider.getCanvas(bounds.size.multiply(scale));
|
||||||
var context = canvas.getContext('2d');
|
var context = canvas.getContext('2d');
|
||||||
|
@ -727,7 +726,7 @@ var Item = Base.extend({
|
||||||
if (item.blendMode !== 'normal'
|
if (item.blendMode !== 'normal'
|
||||||
|| item.opacity < 1
|
|| item.opacity < 1
|
||||||
&& !(item.segments && (!item.fillColor || !item.strokeColor))) {
|
&& !(item.segments && (!item.fillColor || !item.strokeColor))) {
|
||||||
var bounds = item.strokeBounds;
|
var bounds = item.strokeBounds || item.bounds;
|
||||||
if (!bounds.width || !bounds.height)
|
if (!bounds.width || !bounds.height)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,7 @@ var PlacedSymbol = Item.extend({
|
||||||
} else {
|
} else {
|
||||||
this.matrix = new Matrix();
|
this.matrix = new Matrix();
|
||||||
}
|
}
|
||||||
// TODO: this should use strokeBounds:
|
this._bounds = this.symbol.definition.strokeBounds.clone();
|
||||||
this._bounds = this.symbol.definition.bounds.clone();
|
|
||||||
// TODO: should size be cached here, or on Symbol?
|
// TODO: should size be cached here, or on Symbol?
|
||||||
this._size = this._bounds.size;
|
this._size = this._bounds.size;
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,17 +8,17 @@ test('placedSymbol bounds', function() {
|
||||||
|
|
||||||
// These tests currently fail because we haven't implemented
|
// These tests currently fail because we haven't implemented
|
||||||
// Item#strokeBounds yet.
|
// Item#strokeBounds yet.
|
||||||
compareRectangles(placedSymbol.bounds,
|
compareRectangles(placedSymbol.strokeBounds,
|
||||||
new Rectangle(-50.5, -50.5, 101, 101),
|
new Rectangle(-50.5, -50.5, 101, 101),
|
||||||
'PlacedSymbol initial bounds.');
|
'PlacedSymbol initial bounds.');
|
||||||
|
|
||||||
placedSymbol.scale(0.5);
|
placedSymbol.scale(0.5);
|
||||||
compareRectangles(placedSymbol.bounds,
|
compareRectangles(placedSymbol.strokeBounds,
|
||||||
{ x: -25.5, y: -25.5, width: 51, height: 51 },
|
{ x: -25.5, y: -25.5, width: 51, height: 51 },
|
||||||
'Bounds after scale.');
|
'Bounds after scale.');
|
||||||
|
|
||||||
placedSymbol.rotate(40);
|
placedSymbol.rotate(40);
|
||||||
compareRectangles(placedSymbol.bounds,
|
compareRectangles(placedSymbol.strokeBounds,
|
||||||
{ x: -25.50049, y: -25.50049, width: 51.00098, height: 51.00098 },
|
{ x: -25.50049, y: -25.50049, width: 51.00098, height: 51.00098 },
|
||||||
'Bounds after rotation.');
|
'Bounds after rotation.');
|
||||||
});
|
});
|
Loading…
Reference in a new issue