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

View File

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