mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Add TODO about HitResult points requiring transformations.
This commit is contained in:
parent
3b0b1184a3
commit
1e690a68e0
2 changed files with 6 additions and 0 deletions
|
@ -1065,6 +1065,8 @@ function(name) {
|
|||
res;
|
||||
function checkBounds(type, part) {
|
||||
var pt = bounds['get' + part]();
|
||||
// TODO: We need to transform the point back to the coordinate
|
||||
// system of the DOM level on which the inquiry was started!
|
||||
if (point.getDistance(pt) < options.tolerance)
|
||||
return new HitResult(type, that,
|
||||
{ name: Base.hyphenate(part), point: pt });
|
||||
|
|
|
@ -1264,6 +1264,8 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
|||
var coords = [],
|
||||
that = this;
|
||||
function checkPoint(seg, pt, name) {
|
||||
// TODO: We need to transform the point back to the coordinate
|
||||
// system of the DOM level on which the inquiry was started!
|
||||
if (point.getDistance(pt) < tolerance)
|
||||
return new HitResult(name, that, { segment: seg, point: pt });
|
||||
}
|
||||
|
@ -1300,6 +1302,8 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
|||
if (!loc && options.stroke && radius > 0)
|
||||
loc = this.getNearestLocation(point);
|
||||
if (loc && loc._distance <= radius)
|
||||
// TODO: Do we need to transform the location back to the coordinate
|
||||
// system of the DOM level on which the inquiry was started?
|
||||
return options.stroke
|
||||
? new HitResult('stroke', this, { location: loc })
|
||||
: new HitResult('fill', this);
|
||||
|
|
Loading…
Reference in a new issue