Fix scaling and changing hands history

This commit is contained in:
David Rowe 2017-09-14 11:32:58 +12:00
parent 1e2a3a13da
commit d501a8f7cc
2 changed files with 15 additions and 7 deletions

View file

@ -262,7 +262,9 @@ Selection = function (side) {
}
// Add history entry.
if (selection.length > 0) {
if (selection.length > 0
&& (!Vec3.equal(startPosition, rootPosition) || !Quat.equal(startOrientation, rootOrientation))) {
// Positions and orientations can be identical if change grabbing hands when finish scaling.
History.push(
{
setProperties: [

View file

@ -522,8 +522,10 @@
function stopDirectScaling() {
// Called on grabbing hand by scaling hand.
selection.finishDirectScaling();
isDirectScaling = false;
if (isDirectScaling) {
selection.finishDirectScaling();
isDirectScaling = false;
}
}
function startHandleScaling(targetPosition, overlayID) {
@ -557,10 +559,12 @@
function stopHandleScaling() {
// Called on grabbing hand by scaling hand.
handles.finishScaling();
selection.finishHandleScaling();
handles.grab(null); // Stop highlighting grabbed handle and resume displaying all handles.
isHandleScaling = false;
if (isHandleScaling) {
handles.finishScaling();
selection.finishHandleScaling();
handles.grab(null); // Stop highlighting grabbed handle and resume displaying all handles.
isHandleScaling = false;
}
}
@ -739,6 +743,8 @@
}
function exitEditorGrabbing() {
stopDirectScaling();
stopHandleScaling();
finishEditing();
handles.clear();
otherEditor.setHandleOverlays([]);