From adc2942adf0b4afca702aa7787d6ba92038645ab Mon Sep 17 00:00:00 2001 From: Viktor Kovacs Date: Sat, 27 Mar 2021 12:13:25 +0100 Subject: [PATCH] Fix selection change when it is needed to scroll down to the newly selected mesh. --- website/o3dv/menu.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/website/o3dv/menu.js b/website/o3dv/menu.js index ef9cd0b..d6809ba 100644 --- a/website/o3dv/menu.js +++ b/website/o3dv/menu.js @@ -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)