Add "Zoom to Fit" to context menu.

This commit is contained in:
whitequark 2016-10-09 22:26:36 +00:00
parent 2f64f18095
commit 21a4305ee1
2 changed files with 10 additions and 0 deletions

View File

@ -634,6 +634,11 @@ void GraphicsWindow::MouseRightUp(double x, double y) {
AddContextMenuItem("Unselect Hovered", ContextCommand::UNSELECT_HOVERED);
}
if(itemsSelected) {
AddContextMenuItem(NULL, ContextCommand::SEPARATOR);
AddContextMenuItem("Zoom to Fit", ContextCommand::ZOOM_TO_FIT);
}
ContextCommand ret = ShowContextMenu();
switch(ret) {
case ContextCommand::CANCELLED:
@ -710,6 +715,10 @@ void GraphicsWindow::MouseRightUp(double x, double y) {
MenuRequest(Command::CONSTRUCTION);
break;
case ContextCommand::ZOOM_TO_FIT:
MenuView(Command::ZOOM_TO_FIT);
break;
case ContextCommand::SELECT_ALL:
MenuEdit(Command::SELECT_ALL);
break;

View File

@ -140,6 +140,7 @@ enum class ContextCommand : uint32_t {
REMOVE_SPLINE_PT,
ADD_SPLINE_PT,
CONSTRUCTION,
ZOOM_TO_FIT,
SELECT_ALL,
FIRST_STYLE = 0x40000000
};