From 9456716fdea4bc08a4e61ecf2e31f19b4f2a6ec2 Mon Sep 17 00:00:00 2001 From: sir-chaos Date: Thu, 22 Mar 2018 21:58:06 +0000 Subject: [PATCH 1/2] Add width and height parameters to Scene.drillPick On https://github.com/AnalyticalGraphicsInc/cesium/issues/6361 --- Source/Scene/Scene.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 5fa9f8c15c63..0ccae9e96319 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -3579,7 +3579,7 @@ define([ * @example * var pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0)); */ - Scene.prototype.drillPick = function(windowPosition, limit) { + Scene.prototype.drillPick = function(windowPosition, limit, width, height) { // PERFORMANCE_IDEA: This function calls each primitive's update for each pass. Instead // we could update the primitive once, and then just execute their commands for each pass, // and cull commands for picked primitives. e.g., base on the command's owner. @@ -3598,8 +3598,11 @@ define([ if (!defined(limit)) { limit = Number.MAX_VALUE; } + + var drillRectangleWidth = defaultValue(width, 3.0); + var drillRectangleHeight = defaultValue(height, drillRectangleWidth); - var pickedResult = this.pick(windowPosition); + var pickedResult = this.pick(windowPosition, drillRectangleWidth, drillRectangleHeight); while (defined(pickedResult) && defined(pickedResult.primitive)) { result.push(pickedResult); if (0 >= --limit) { @@ -3627,7 +3630,7 @@ define([ pickedPrimitives.push(primitive); } - pickedResult = this.pick(windowPosition); + pickedResult = this.pick(windowPosition, drillRectangleWidth, drillRectangleHeight); } // unhide everything we hid while drill picking From d3829f683f165f950fa332a9e7c9f41b518b22b8 Mon Sep 17 00:00:00 2001 From: sir-chaos Date: Fri, 23 Mar 2018 06:34:24 +0000 Subject: [PATCH 2/2] Adapt for eslint --- Source/Scene/Scene.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 0ccae9e96319..71bbcc9a812a 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -3598,7 +3598,7 @@ define([ if (!defined(limit)) { limit = Number.MAX_VALUE; } - + var drillRectangleWidth = defaultValue(width, 3.0); var drillRectangleHeight = defaultValue(height, drillRectangleWidth);