2011-07-01 05:26:51 -04:00
|
|
|
/*
|
2013-01-28 21:03:27 -05:00
|
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
2011-07-01 05:26:51 -04:00
|
|
|
* http://paperjs.org/
|
2011-07-01 06:01:32 -04:00
|
|
|
*
|
2013-01-28 21:03:27 -05:00
|
|
|
* Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey
|
2011-07-01 05:26:51 -04:00
|
|
|
* 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.
|
|
|
|
*
|
2011-07-01 05:26:51 -04:00
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name PlacedItem
|
2011-07-01 06:01:32 -04:00
|
|
|
*
|
2011-07-01 05:26:51 -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
|
|
|
*
|
2011-07-01 05:26:51 -04:00
|
|
|
* @extends Item
|
|
|
|
*/
|
|
|
|
var PlacedItem = this.PlacedItem = Item.extend(/** @lends PlacedItem# */{
|
2011-11-24 10:03:05 -05:00
|
|
|
// PlacedItem uses strokeBounds for bounds
|
2012-12-15 11:19:10 -05:00
|
|
|
_boundsGetter: { getBounds: 'getStrokeBounds' },
|
2012-11-23 14:29:36 -05:00
|
|
|
|
|
|
|
_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;
|
2012-11-23 14:29:36 -05:00
|
|
|
}
|
|
|
|
});
|