2011-07-01 05:26:51 -04:00
|
|
|
/*
|
|
|
|
* Paper.js
|
|
|
|
*
|
|
|
|
* This file is part of Paper.js, a JavaScript Vector Graphics Library,
|
|
|
|
* based on Scriptographer.org and designed to be largely API compatible.
|
|
|
|
* http://paperjs.org/
|
|
|
|
* http://scriptographer.org/
|
|
|
|
*
|
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
|
|
|
|
* http://lehni.org/ & http://jonathanpuckey.com/
|
|
|
|
*
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name PlacedItem
|
|
|
|
*
|
|
|
|
* @class The PlacedItem class is the base for any items that have a matrix
|
|
|
|
* associated with them, describing their placement in the project, such as
|
|
|
|
* {@link Raster} and {@link PlacedSymbol}.
|
|
|
|
*
|
|
|
|
* @extends Item
|
|
|
|
*/
|
|
|
|
var PlacedItem = this.PlacedItem = Item.extend(/** @lends PlacedItem# */{
|
|
|
|
|
|
|
|
_transform: function(matrix, flags) {
|
|
|
|
// In order to set the right context transformation when drawing the
|
|
|
|
// raster, simply preconcatenate the internal matrix with the provided
|
|
|
|
// one.
|
2011-07-01 05:32:09 -04:00
|
|
|
this._matrix.preConcatenate(matrix);
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The item's transformation matrix, defining position and dimensions in the
|
|
|
|
* document.
|
|
|
|
*
|
|
|
|
* @type Matrix
|
|
|
|
* @bean
|
|
|
|
*/
|
|
|
|
getMatrix: function() {
|
|
|
|
return this._matrix;
|
|
|
|
},
|
|
|
|
|
|
|
|
setMatrix: function(matrix) {
|
|
|
|
this._matrix = matrix.clone();
|
|
|
|
this._changed(Change.GEOMETRY);
|
2011-07-01 05:26:51 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
getStrokeBounds: function() {
|
|
|
|
return this.getBounds();
|
|
|
|
}
|
|
|
|
});
|