2011-07-01 11:26:51 +02:00
|
|
|
/*
|
|
|
|
* Paper.js
|
2011-07-01 12:01:32 +02:00
|
|
|
*
|
2011-07-01 11:26:51 +02: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 12:01:32 +02:00
|
|
|
*
|
2011-07-01 11:26:51 +02:00
|
|
|
* Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
|
|
|
|
* http://lehni.org/ & http://jonathanpuckey.com/
|
2011-07-01 12:01:32 +02:00
|
|
|
*
|
2011-07-01 12:17:45 +02:00
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
2011-07-01 11:26:51 +02:00
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name PlacedItem
|
2011-07-01 12:01:32 +02:00
|
|
|
*
|
2011-07-01 11:26:51 +02: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 12:01:32 +02:00
|
|
|
*
|
2011-07-01 11:26:51 +02:00
|
|
|
* @extends Item
|
|
|
|
*/
|
|
|
|
var PlacedItem = this.PlacedItem = Item.extend(/** @lends PlacedItem# */{
|
2011-11-24 16:03:05 +01:00
|
|
|
// PlacedItem uses strokeBounds for bounds
|
2012-11-23 20:29:36 +01:00
|
|
|
_boundsType: { bounds: 'strokeBounds' },
|
|
|
|
|
|
|
|
_hitTest: function(point, options, matrix) {
|
2012-11-23 20:48:34 +01:00
|
|
|
var hitResult = this._symbol._definition.hitTest(
|
2012-11-23 20:55:46 +01:00
|
|
|
this.matrix._transformPoint(point), options, matrix);
|
2012-11-23 20:29:36 +01:00
|
|
|
// TODO: When the symbol's definition is a path, should hitResult contain
|
|
|
|
// information like HitResult#curve?
|
|
|
|
if (hitResult)
|
|
|
|
hitResult.item = this;
|
|
|
|
return hitResult;
|
|
|
|
}
|
|
|
|
});
|