Add "Toggle Construction" to context menu.

pull/66/head
whitequark 2016-10-09 22:13:01 +00:00
parent da2d035200
commit 2f4c6a6b0e
2 changed files with 8 additions and 1 deletions

View File

@ -570,7 +570,6 @@ void GraphicsWindow::MouseRightUp(double x, double y) {
AddContextMenuItem("Snap to Grid", ContextCommand::SNAP_TO_GRID); AddContextMenuItem("Snap to Grid", ContextCommand::SNAP_TO_GRID);
} }
if(gs.points == 1 && gs.point[0].isFromRequest()) { if(gs.points == 1 && gs.point[0].isFromRequest()) {
Request *r = SK.GetRequest(gs.point[0].request()); Request *r = SK.GetRequest(gs.point[0].request());
int index = r->IndexOfPoint(gs.point[0]); int index = r->IndexOfPoint(gs.point[0]);
@ -590,6 +589,9 @@ void GraphicsWindow::MouseRightUp(double x, double y) {
AddContextMenuItem("Add Spline Point", ContextCommand::ADD_SPLINE_PT); AddContextMenuItem("Add Spline Point", ContextCommand::ADD_SPLINE_PT);
} }
} }
if(gs.entities == gs.n) {
AddContextMenuItem("Toggle Construction", ContextCommand::CONSTRUCTION);
}
if(gs.points == 1) { if(gs.points == 1) {
Entity *p = SK.GetEntity(gs.point[0]); Entity *p = SK.GetEntity(gs.point[0]);
@ -702,6 +704,10 @@ void GraphicsWindow::MouseRightUp(double x, double y) {
MenuEdit(Command::SNAP_TO_GRID); MenuEdit(Command::SNAP_TO_GRID);
break; break;
case ContextCommand::CONSTRUCTION:
MenuRequest(Command::CONSTRUCTION);
break;
case ContextCommand::REMOVE_SPLINE_PT: { case ContextCommand::REMOVE_SPLINE_PT: {
hRequest hr = gs.point[0].request(); hRequest hr = gs.point[0].request();
Request *r = SK.GetRequest(hr); Request *r = SK.GetRequest(hr);

View File

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