Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate MIDDLE_DOUBLE_CLICK and RIGHT_DOUBLE_CLICK events #4910

Merged
merged 3 commits into from
Jan 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Apps/Sandcastle/gallery/development/Shadows.html
Original file line number Diff line number Diff line change
Expand Up @@ -703,25 +703,25 @@

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)) {
var castShadows = Cesium.ShadowMode.castShadows(picked.primitive.shadows);
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)) {
var castShadows = Cesium.ShadowMode.castShadows(picked.primitive.shadows);
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();
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 17 additions & 1 deletion Source/Core/ScreenSpaceEventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ define([
'./Cartesian2',
'./defaultValue',
'./defined',
'./deprecationWarning',
'./destroyObject',
'./DeveloperError',
'./FeatureDetection',
Expand All @@ -15,6 +16,7 @@ define([
Cartesian2,
defaultValue,
defined,
deprecationWarning,
destroyObject,
DeveloperError,
FeatureDetection,
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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.
*
Expand All @@ -705,6 +715,8 @@ define([
}
//>>includeEnd('debug');

checkForDoubleClick(type);

var key = getInputEventKey(type, modifier);
this._inputEvents[key] = action;
};
Expand All @@ -726,6 +738,8 @@ define([
}
//>>includeEnd('debug');

checkForDoubleClick(type);

var key = getInputEventKey(type, modifier);
return this._inputEvents[key];
};
Expand All @@ -747,6 +761,8 @@ define([
}
//>>includeEnd('debug');

checkForDoubleClick(type);

var key = getInputEventKey(type, modifier);
delete this._inputEvents[key];
};
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/ScreenSpaceEventType.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ define([
*
* @type {Number}
* @constant
*
* @deprecated
*/
RIGHT_DOUBLE_CLICK : 8,

Expand Down Expand Up @@ -104,6 +106,8 @@ define([
*
* @type {Number}
* @constant
*
* @deprecated
*/
MIDDLE_DOUBLE_CLICK : 13,

Expand Down