From 1e690a68e09f14f2cccba81b117e8f5554ddeba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 25 Dec 2011 12:39:10 +0100 Subject: [PATCH] Add TODO about HitResult points requiring transformations. --- src/item/Item.js | 2 ++ src/path/Path.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/item/Item.js b/src/item/Item.js index 07800b7e..deb3d732 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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 }); diff --git a/src/path/Path.js b/src/path/Path.js index 667dadf2..bad2a599 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -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);