mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 08:17:11 +02:00
correctly draw tools when in orbit mode
This commit is contained in:
parent
61d9ea44af
commit
cbacf5f328
1 changed files with 14 additions and 0 deletions
|
@ -247,6 +247,7 @@ var trackLastMouseY = 0;
|
|||
var trackAsDelete = false;
|
||||
var trackAsRecolor = false;
|
||||
var trackAsEyedropper = false;
|
||||
var trackAsOrbit = false;
|
||||
|
||||
function showPreviewVoxel() {
|
||||
var voxelColor;
|
||||
|
@ -293,6 +294,8 @@ function showPreviewVoxel() {
|
|||
solid: true,
|
||||
alpha: 0.8
|
||||
});
|
||||
} else if (trackAsOrbit) {
|
||||
Overlays.editOverlay(voxelPreview, { visible: false });
|
||||
} else if (!isExtruding) {
|
||||
guidePosition = { x: intersection.voxel.x,
|
||||
y: intersection.voxel.y,
|
||||
|
@ -440,6 +443,7 @@ function trackMouseEvent(event) {
|
|||
trackAsDelete = event.isControl;
|
||||
trackAsRecolor = event.isShifted;
|
||||
trackAsEyedropper = event.isMeta;
|
||||
trackAsOrbit = event.isAlt;
|
||||
showPreviewGuides();
|
||||
}
|
||||
|
||||
|
@ -456,6 +460,10 @@ function trackKeyPressEvent(event) {
|
|||
trackAsEyedropper = true;
|
||||
moveTools();
|
||||
}
|
||||
if (event.text == "ALT") {
|
||||
trackAsOrbit = true;
|
||||
moveTools();
|
||||
}
|
||||
showPreviewGuides();
|
||||
}
|
||||
|
||||
|
@ -472,6 +480,10 @@ function trackKeyReleaseEvent(event) {
|
|||
trackAsEyedropper = false;
|
||||
moveTools();
|
||||
}
|
||||
if (event.text == "ALT") {
|
||||
trackAsOrbit = false;
|
||||
moveTools();
|
||||
}
|
||||
|
||||
// on TAB release, toggle our tool state
|
||||
if (event.text == "TAB") {
|
||||
|
@ -763,6 +775,8 @@ function moveTools() {
|
|||
recolorToolColor = toolSelectedColor;
|
||||
} else if (trackAsEyedropper) {
|
||||
eyedropperToolColor = toolSelectedColor;
|
||||
} else if (trackAsOrbit) {
|
||||
// nothing gets selected in this case...
|
||||
} else {
|
||||
addToolColor = toolSelectedColor;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue