Fix selection change when it is needed to scroll down to the newly selected mesh.

This commit is contained in:
Viktor Kovacs 2021-03-27 12:13:25 +01:00
parent 0271fc4441
commit adc2942adf

View File

@ -185,25 +185,30 @@ OV.Menu = class
}
}
function SetCurrentSelection (obj, selection)
{
obj.selection = selection;
obj.UpdateInfoPanel ();
}
let oldSelection = this.selection;
if (oldSelection !== null) {
SetEntitySelection (this, oldSelection, false);
}
this.selection = selection;
SetCurrentSelection (this, selection);
this.tempSelectedMeshIndex = null;
if (this.selection !== null) {
if (oldSelection !== null && this.selection.type === oldSelection.type && this.selection.index === oldSelection.index) {
SetEntitySelection (this, this.selection, false);
this.selection = null;
SetCurrentSelection (this, null);
} else {
SetEntitySelection (this, this.selection, true);
}
}
this.callbacks.updateMeshesSelection ();
this.UpdateInfoPanel ();
}
FitMeshToWindow (meshIndex)