Skip to content

Commit

Permalink
rename variable for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jjspace committed Aug 23, 2024
1 parent 4c164a6 commit b69914d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/engine/Source/Scene/CameraEventAggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,19 @@ function cloneMouseMovement(mouseMovement, result) {
Cartesian2.clone(mouseMovement.endPosition, result.endPosition);
}

function anyBUttonIsDown(type, modifier, aggregator) {
function refreshMouseDownStatus(type, modifier, aggregator) {
// first: Judge if the mouse is pressed
const isDown = aggregator._isDown;
let downFlag = false;
let anyButtonIsDown = false;
const currentKey = getKey(type, modifier);
for (const [downKey, downValue] of Object.entries(isDown)) {
if (downKey.startsWith(type) && downValue && downKey !== currentKey) {
downFlag = true;
anyButtonIsDown = true;
cancelMouseDownAction(downKey, aggregator);
}
}

if (!downFlag) {
if (!anyButtonIsDown) {
return;
}

Expand Down Expand Up @@ -314,7 +314,7 @@ function listenMouseMove(aggregator, modifier) {
const type = CameraEventType[typeName];
if (defined(type)) {
const key = getKey(type, modifier);
anyBUttonIsDown(type, modifier, aggregator);
refreshMouseDownStatus(type, modifier, aggregator);
if (isDown[key]) {
if (!update[key]) {
Cartesian2.clone(
Expand Down

0 comments on commit b69914d

Please sign in to comment.