Merge remote-tracking branch 'origin/master'

This commit is contained in:
Jürg Lehni 2011-03-03 16:33:01 +00:00
commit e9881c02fc
24 changed files with 27 additions and 8 deletions

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
var count = 0;
var doc;

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
var count = 0;
var doc;

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
var count = 0;
var doc;

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
var count = 0;
var doc;

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -32,6 +32,7 @@
<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/GradientStop.js"></script>
<script type="text/javascript" src="../../src/util/CanvasProvider.js"></script>
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');

View file

@ -540,8 +540,7 @@ var Item = Base.extend({
// question for now.
if (!resolution)
resolution = 72;
// TODO: use strokebounds for this:
var bounds = this.bounds;
var bounds = this.strokeBounds;
var scale = resolution / 72;
var canvas = CanvasProvider.getCanvas(bounds.size.multiply(scale));
var context = canvas.getContext('2d');
@ -727,7 +726,7 @@ var Item = Base.extend({
if (item.blendMode !== 'normal'
|| item.opacity < 1
&& !(item.segments && (!item.fillColor || !item.strokeColor))) {
var bounds = item.strokeBounds;
var bounds = item.strokeBounds || item.bounds;
if (!bounds.width || !bounds.height)
return;

View file

@ -19,8 +19,7 @@ var PlacedSymbol = Item.extend({
} else {
this.matrix = new Matrix();
}
// TODO: this should use strokeBounds:
this._bounds = this.symbol.definition.bounds.clone();
this._bounds = this.symbol.definition.strokeBounds.clone();
// TODO: should size be cached here, or on Symbol?
this._size = this._bounds.size;
},

View file

@ -8,17 +8,17 @@ test('placedSymbol bounds', function() {
// These tests currently fail because we haven't implemented
// Item#strokeBounds yet.
compareRectangles(placedSymbol.bounds,
compareRectangles(placedSymbol.strokeBounds,
new Rectangle(-50.5, -50.5, 101, 101),
'PlacedSymbol initial bounds.');
placedSymbol.scale(0.5);
compareRectangles(placedSymbol.bounds,
compareRectangles(placedSymbol.strokeBounds,
{ x: -25.5, y: -25.5, width: 51, height: 51 },
'Bounds after scale.');
placedSymbol.rotate(40);
compareRectangles(placedSymbol.bounds,
compareRectangles(placedSymbol.strokeBounds,
{ x: -25.50049, y: -25.50049, width: 51.00098, height: 51.00098 },
'Bounds after rotation.');
});