From e3c624597951095bbf4eecdcc6f1c7e1a55bd450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 15 Feb 2017 16:11:33 +0100 Subject: [PATCH] Docs: Improve description of option.class value in #hitTest() See #632 --- src/item/Item.js | 8 +++++--- src/item/Project.js | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index 1d031b0b..66d4cd92 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1814,9 +1814,11 @@ new function() { // Injection scope for hit-test functions shared with project * * @option [options.tolerance={@link PaperScope#settings}.hitTolerance] * {Number} the tolerance of the hit-test - * @option options.class {Function} only hit-test again a certain item - * class and its sub-classes: {@values Group, Layer, Path, - * CompoundPath, Shape, Raster, SymbolItem, PointText, ...} + * @option options.class {Function} only hit-test against a specific item + * class, or any of its sub-classes, by providing the constructor + * function against which an `instanceof` check is performed: + * {@values Group, Layer, Path, CompoundPath, Shape, Raster, + * SymbolItem, PointText, ...} * @option options.match {Function} a match function to be called for each * found hit result: Return `true` to return the result, `false` to keep * searching diff --git a/src/item/Project.js b/src/item/Project.js index 8327a34d..7ffb8ade 100644 --- a/src/item/Project.js +++ b/src/item/Project.js @@ -405,9 +405,11 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{ * * @option [options.tolerance={@link PaperScope#settings}.hitTolerance] * {Number} the tolerance of the hit-test - * @option options.class {Function} only hit-test again a certain item - * class and its sub-classes: {@values Group, Layer, Path, - * CompoundPath, Shape, Raster, SymbolItem, PointText, ...} + * @option options.class {Function} only hit-test against a specific item + * class, or any of its sub-classes, by providing the constructor + * function against which an `instanceof` check is performed: + * {@values Group, Layer, Path, CompoundPath, Shape, Raster, + * SymbolItem, PointText, ...} * @option options.match {Function} a match function to be called for each * found hit result: Return `true` to return the result, `false` to keep * searching