Skip to content

Commit

Permalink
Rearrange canvas context menu items for better UX
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Mar 18, 2021
1 parent 489e371 commit 462359c
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/contextMenus/CanvasContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ class CanvasContextMenu extends ContextMenu {
super({
context: cfg.context,
items: [
[
{
title: "View Fit All",
doAction: function (context) {
const viewer = context.viewer;
const scene = viewer.scene;
const sceneAABB = scene.getAABB(scene.visibleObjectIds);
viewer.cameraFlight.flyTo({
aabb: sceneAABB,
duration: 0.5
});
viewer.cameraControl.pivotPos = math.getAABB3Center(sceneAABB);
}
}
],
[
{
title: "Hide All",
Expand All @@ -32,21 +47,6 @@ class CanvasContextMenu extends ContextMenu {
}
}
],
[
{
title: "View Fit All",
doAction: function (context) {
const viewer = context.viewer;
const scene = viewer.scene;
const sceneAABB = scene.getAABB(scene.visibleObjectIds);
viewer.cameraFlight.flyTo({
aabb: sceneAABB,
duration: 0.5
});
viewer.cameraControl.pivotPos = math.getAABB3Center(sceneAABB);
}
}
],
[
{
title: "X-Ray All",
Expand Down

0 comments on commit 462359c

Please sign in to comment.