paper.js/src/item/PlacedItem.js

34 lines
1,018 B
JavaScript
Raw Normal View History

/*
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
2011-07-01 06:01:32 -04:00
*
* Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey
* http://lehni.org/ & http://jonathanpuckey.com/
2011-07-01 06:01:32 -04:00
*
2011-07-01 06:17:45 -04:00
* Distributed under the MIT license. See LICENSE file for details.
*
* All rights reserved.
*/
/**
* @name PlacedItem
2011-07-01 06:01:32 -04:00
*
* @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}.
2011-07-01 06:01:32 -04:00
*
* @extends Item
*/
var PlacedItem = this.PlacedItem = Item.extend(/** @lends PlacedItem# */{
// PlacedItem uses strokeBounds for bounds
_boundsGetter: { getBounds: 'getStrokeBounds' },
_hitTest: function(point, options, matrix) {
2012-12-25 12:09:42 -05:00
var result = this._symbol._definition._hitTest(point, options, matrix);
// TODO: When the symbol's definition is a path, should hitResult
// contain information like HitResult#curve?
if (result)
result.item = this;
return result;
}
});