2011-07-01 05:26:51 -04:00
|
|
|
/*
|
|
|
|
* Paper.js
|
2011-07-01 06:01:32 -04:00
|
|
|
*
|
2011-07-01 05:26:51 -04:00
|
|
|
* 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/
|
2011-07-01 06:01:32 -04:00
|
|
|
*
|
2011-07-01 05:26:51 -04:00
|
|
|
* Copyright (c) 2011, 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.
|
|
|
|
*
|
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-11-23 14:29:36 -05:00
|
|
|
_boundsType: { bounds: 'strokeBounds' },
|
|
|
|
|
|
|
|
_hitTest: function(point, options, matrix) {
|
2012-11-23 14:48:34 -05:00
|
|
|
var hitResult = this._symbol._definition.hitTest(
|
2012-11-23 14:55:46 -05:00
|
|
|
this.matrix._transformPoint(point), options, matrix);
|
2012-11-23 14:29:36 -05:00
|
|
|
// TODO: When the symbol's definition is a path, should hitResult contain
|
|
|
|
// information like HitResult#curve?
|
|
|
|
if (hitResult)
|
|
|
|
hitResult.item = this;
|
|
|
|
return hitResult;
|
|
|
|
}
|
|
|
|
});
|