Skip to content

Commit e142b09

Browse files
author
Hannah
authoredNov 1, 2018
Merge pull request #7218 from AnalyticalGraphicsInc/revert-7137
Reverts #7137
2 parents 7c178da + f8e7075 commit e142b09

File tree

4 files changed

+24
-39
lines changed

4 files changed

+24
-39
lines changed
 

‎CHANGES.md

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Change Log
2525
* Fixed clipping plane crash when adding a plane to an empty collection. [#7168](https://github.com/AnalyticalGraphicsInc/cesium/pull/7168)
2626
* Fixed texture coordinate calculation for polygon entities with `perPositionHeight` [#7188](https://github.com/AnalyticalGraphicsInc/cesium/pull/7188)
2727
* Fixed clipping planes on tilesets not taking into account the tileset model matrix. [#7182](https://github.com/AnalyticalGraphicsInc/cesium/pull/7182)
28-
* Fixed middle mouse button locked glitch [#7137](https://github.com/AnalyticalGraphicsInc/cesium/pull/7137)
2928
* Fixed an issue where dynamic Entities on terrain would cause a crash in platforms that do not support depth textures such as Internet Explorer [#7103](https://github.com/AnalyticalGraphicsInc/cesium/issues/7103)
3029
* Fixed an issue that would cause a crash when removing a post process stage. [#7210](https://github.com/AnalyticalGraphicsInc/cesium/issues/7210)
3130

‎CONTRIBUTORS.md

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
117117
* [Chris Cooper](https://github.com/chris-cooper)
118118
* [Andrew McDowell](https://github.com/madole)
119119
* [Tony Luk](https://github.com/impactblue573)
120-
* [Daniel Cooper](https://github.com/moodragon46)
121120
* [GeoFS](https://www.geo-fs.com)
122121
* [Xavier Tassin](https://github.com/xtassin/)
123122

‎Source/Core/ScreenSpaceEventHandler.js

+23-18
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,29 @@ define([
176176
position : new Cartesian2()
177177
};
178178

179-
function cancelMouseEvent(screenSpaceEventHandler, screenSpaceEventType, clickScreenSpaceEventType, event) {
179+
function handleMouseUp(screenSpaceEventHandler, event) {
180+
if (!canProcessMouseEvent(screenSpaceEventHandler)) {
181+
return;
182+
}
183+
184+
var button = event.button;
185+
screenSpaceEventHandler._buttonDown = undefined;
186+
187+
var screenSpaceEventType;
188+
var clickScreenSpaceEventType;
189+
if (button === MouseButton.LEFT) {
190+
screenSpaceEventType = ScreenSpaceEventType.LEFT_UP;
191+
clickScreenSpaceEventType = ScreenSpaceEventType.LEFT_CLICK;
192+
} else if (button === MouseButton.MIDDLE) {
193+
screenSpaceEventType = ScreenSpaceEventType.MIDDLE_UP;
194+
clickScreenSpaceEventType = ScreenSpaceEventType.MIDDLE_CLICK;
195+
} else if (button === MouseButton.RIGHT) {
196+
screenSpaceEventType = ScreenSpaceEventType.RIGHT_UP;
197+
clickScreenSpaceEventType = ScreenSpaceEventType.RIGHT_CLICK;
198+
} else {
199+
return;
200+
}
201+
180202
var modifier = getModifier(event);
181203

182204
var action = screenSpaceEventHandler.getInputAction(screenSpaceEventType, modifier);
@@ -206,23 +228,6 @@ define([
206228
}
207229
}
208230

209-
function handleMouseUp(screenSpaceEventHandler, event) {
210-
if (!canProcessMouseEvent(screenSpaceEventHandler)) {
211-
return;
212-
}
213-
214-
var button = event.button;
215-
screenSpaceEventHandler._buttonDown = undefined;
216-
217-
if (button !== MouseButton.LEFT && button !== MouseButton.MIDDLE && button !== MouseButton.RIGHT){
218-
return;
219-
}
220-
221-
cancelMouseEvent(screenSpaceEventHandler, ScreenSpaceEventType.LEFT_UP, ScreenSpaceEventType.LEFT_CLICK, event);
222-
cancelMouseEvent(screenSpaceEventHandler, ScreenSpaceEventType.MIDDLE_UP, ScreenSpaceEventType.MIDDLE_CLICK, event);
223-
cancelMouseEvent(screenSpaceEventHandler, ScreenSpaceEventType.RIGHT_UP, ScreenSpaceEventType.RIGHT_CLICK, event);
224-
}
225-
226231
var mouseMoveEvent = {
227232
startPosition : new Cartesian2(),
228233
endPosition : new Cartesian2()

‎Specs/Scene/CameraEventAggregatorSpec.js

+1-19
Original file line numberDiff line numberDiff line change
@@ -216,28 +216,10 @@ defineSuite([
216216
expect(handler.anyButtonDown).toEqual(true);
217217

218218
simulateMouseUp(options);
219+
expect(handler.anyButtonDown).toEqual(true);
219220

220221
options.button = MouseButtons.LEFT;
221222
simulateMouseUp(options);
222-
223-
expect(handler.anyButtonDown).toEqual(false);
224-
});
225-
226-
it('cancels anyButtonDown on any button up', function() {
227-
expect(handler.anyButtonDown).toEqual(false);
228-
229-
var options = {
230-
button : MouseButtons.LEFT,
231-
clientX : 0,
232-
clientY : 0
233-
};
234-
simulateMouseDown(options);
235-
236-
options.button = MouseButtons.RIGHT;
237-
simulateMouseDown(options);
238-
239-
simulateMouseUp(options);
240-
241223
expect(handler.anyButtonDown).toEqual(false);
242224
});
243225

0 commit comments

Comments
 (0)
Please sign in to comment.