diff --git a/Apps/Sandcastle/gallery/development/Shadows.html b/Apps/Sandcastle/gallery/development/Shadows.html index 86c743789516..1f907c7ce13b 100644 --- a/Apps/Sandcastle/gallery/development/Shadows.html +++ b/Apps/Sandcastle/gallery/development/Shadows.html @@ -703,7 +703,7 @@ var handler = new Cesium.ScreenSpaceEventHandler(canvas); -// Double click object to turn castShadows on/off +// Click object to turn castShadows on/off handler.setInputAction(function(movement) { var picked = scene.pick(movement.position); if (Cesium.defined(picked) && Cesium.defined(picked.primitive)) { @@ -711,9 +711,9 @@ var receiveShadows = Cesium.ShadowMode.receiveShadows(picked.primitive.shadows); picked.primitive.shadows = Cesium.ShadowMode.fromCastReceive(!castShadows, receiveShadows); } -}, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK); +}, Cesium.ScreenSpaceEventType.LEFT_CLICK); -// Double middle click object to turn receiveShadows on/off +// Middle click object to turn receiveShadows on/off handler.setInputAction(function(movement) { var picked = scene.pick(movement.position); if (Cesium.defined(picked)) { @@ -721,7 +721,7 @@ var receiveShadows = Cesium.ShadowMode.receiveShadows(picked.primitive.shadows); picked.primitive.shadows = Cesium.ShadowMode.fromCastReceive(castShadows, !receiveShadows); } -}, Cesium.ScreenSpaceEventType.MIDDLE_DOUBLE_CLICK); +}, Cesium.ScreenSpaceEventType.MIDDLE_CLICK); //Sandcastle_End Sandcastle.finishedLoading(); diff --git a/CHANGES.md b/CHANGES.md index 41f701272b5a..b205bee78f47 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ Change Log * Deprecated * The properties `url` and `key` will be removed from `GeocoderViewModel` in 1.31. These properties will be available on geocoder services that support them, like `BingMapsGeocoderService`. * The function `createBinormalAndBitangent` of `GeometryPipeline` will be removed in 1.31. Use the function `createTangentAndBitangent` instead. [#4856](https://github.com/AnalyticalGraphicsInc/cesium/pull/4856) + * The enums `MIDDLE_DOUBLE_CLICK` and `RIGHT_DOUBLE_CLICK` from `ScreenSpaceEventType` have been deprecated and will be removed in 1.31. [#4910](https://github.com/AnalyticalGraphicsInc/cesium/pull/4910) * Breaking changes * Removed separate `heading`, `pitch`, `roll` parameters from `Transform.headingPitchRollToFixedFrame` and `Transform.headingPitchRollQuaternion`. Pass a `headingPitchRoll` object instead. [#4843](https://github.com/AnalyticalGraphicsInc/cesium/pull/4843) * The property `binornmal` has been renamed to `bitangent` for `Geometry` and `VertexFormat`. [#4856](https://github.com/AnalyticalGraphicsInc/cesium/pull/4856) diff --git a/Source/Core/ScreenSpaceEventHandler.js b/Source/Core/ScreenSpaceEventHandler.js index 7c702c2b7348..a22670eb7688 100644 --- a/Source/Core/ScreenSpaceEventHandler.js +++ b/Source/Core/ScreenSpaceEventHandler.js @@ -4,6 +4,7 @@ define([ './Cartesian2', './defaultValue', './defined', + './deprecationWarning', './destroyObject', './DeveloperError', './FeatureDetection', @@ -15,6 +16,7 @@ define([ Cartesian2, defaultValue, defined, + deprecationWarning, destroyObject, DeveloperError, FeatureDetection, @@ -483,7 +485,7 @@ define([ action(touch2StartEvent); - // Touch-enabled devices, in particular iOS can have many default behaviours for + // Touch-enabled devices, in particular iOS can have many default behaviours for // "pinch" events, which can still be executed unless we prevent them here. event.preventDefault(); } @@ -684,6 +686,14 @@ define([ registerListeners(this); } + function checkForDoubleClick(type) { + if (type === ScreenSpaceEventType.MIDDLE_DOUBLE_CLICK) { + deprecationWarning('MIDDLE_DOUBLE_CLICK', 'ScreenSpaceEventType.MIDDLE_DOUBLE_CLICK was deprecated in Cesium 1.30. It will be removed in 1.31.'); + } else if (type === ScreenSpaceEventType.RIGHT_DOUBLE_CLICK) { + deprecationWarning('RIGHT_DOUBLE_CLICK', 'ScreenSpaceEventType.RIGHT_DOUBLE_CLICK was deprecated in Cesium 1.30. It will be removed in 1.31.'); + } + } + /** * Set a function to be executed on an input event. * @@ -705,6 +715,8 @@ define([ } //>>includeEnd('debug'); + checkForDoubleClick(type); + var key = getInputEventKey(type, modifier); this._inputEvents[key] = action; }; @@ -726,6 +738,8 @@ define([ } //>>includeEnd('debug'); + checkForDoubleClick(type); + var key = getInputEventKey(type, modifier); return this._inputEvents[key]; }; @@ -747,6 +761,8 @@ define([ } //>>includeEnd('debug'); + checkForDoubleClick(type); + var key = getInputEventKey(type, modifier); delete this._inputEvents[key]; }; diff --git a/Source/Core/ScreenSpaceEventType.js b/Source/Core/ScreenSpaceEventType.js index 323ef3867b4e..9cc2428da497 100644 --- a/Source/Core/ScreenSpaceEventType.js +++ b/Source/Core/ScreenSpaceEventType.js @@ -72,6 +72,8 @@ define([ * * @type {Number} * @constant + * + * @deprecated */ RIGHT_DOUBLE_CLICK : 8, @@ -104,6 +106,8 @@ define([ * * @type {Number} * @constant + * + * @deprecated */ MIDDLE_DOUBLE_CLICK : 13,