Add TODO about HitResult points requiring transformations.

This commit is contained in:
Jürg Lehni 2011-12-25 12:39:10 +01:00
parent 3b0b1184a3
commit 1e690a68e0
2 changed files with 6 additions and 0 deletions

View file

@ -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 });

View file

@ -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);