Remove mesh isolation by ctrl+click.
This commit is contained in:
parent
471a6cd3fa
commit
9bdd924b2f
@ -413,8 +413,7 @@ OV.Navigation = class
|
||||
this.mouse.Up (this.canvas, ev);
|
||||
this.clickDetector.Up (ev);
|
||||
if (this.clickDetector.IsClick ()) {
|
||||
let isCtrlPressed = (ev.ctrlKey || ev.metaKey);
|
||||
this.Click (ev.which, isCtrlPressed, ev.clientX, ev.clientY);
|
||||
this.Click (ev.which, ev.clientX, ev.clientY);
|
||||
}
|
||||
}
|
||||
|
||||
@ -551,11 +550,11 @@ OV.Navigation = class
|
||||
}
|
||||
}
|
||||
|
||||
Click (button, isCtrlPressed, clientX, clientY)
|
||||
Click (button, clientX, clientY)
|
||||
{
|
||||
if (this.onClick) {
|
||||
let mouseCoords = OV.GetClientCoordinates (this.canvas, clientX, clientY);
|
||||
this.onClick (button, isCtrlPressed, mouseCoords);
|
||||
this.onClick (button, mouseCoords);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,11 +63,7 @@ OV.MeshData = class
|
||||
|
||||
this.showHideButton = new OV.TreeViewButton ('assets/images/navigator/visible.svg');
|
||||
this.showHideButton.OnClick ((ev) => {
|
||||
if (ev.ctrlKey || ev.metaKey) {
|
||||
callbacks.onIsolate (this.originalIndex);
|
||||
} else {
|
||||
callbacks.onShowHide (this.originalIndex);
|
||||
}
|
||||
});
|
||||
this.menuItem.AddButton (this.showHideButton);
|
||||
|
||||
|
||||
@ -138,21 +138,17 @@ OV.Website = class
|
||||
this.FitModelToWindow (true);
|
||||
}
|
||||
|
||||
OnModelClicked (button, isCtrlPressed, mouseCoordinates)
|
||||
OnModelClicked (button, mouseCoordinates)
|
||||
{
|
||||
if (button === 1) {
|
||||
let meshUserData = this.viewer.GetMeshUserDataUnderMouse (mouseCoordinates);
|
||||
if (meshUserData === null) {
|
||||
this.navigator.SetSelection (null);
|
||||
} else {
|
||||
if (isCtrlPressed) {
|
||||
this.navigator.IsolateMesh (meshUserData.originalMeshIndex);
|
||||
} else {
|
||||
this.navigator.SetSelection (new OV.Selection (OV.SelectionType.Mesh, meshUserData.originalMeshIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OnModelContextMenu (globalMouseCoordinates, mouseCoordinates)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user