From ea00c7e9793a0a686f2aed5561492e59a826bc13 Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Wed, 30 Sep 2009 00:54:01 -0800 Subject: [PATCH] Increment the version number, and add a context menu item to snap what's hovered to the grid. [git-p4: depot-paths = "//depot/solvespace/": change = 2042] --- mouse.cpp | 14 ++++++++++++++ solvespace.cpp | 2 +- ui.h | 1 + wishlist.txt | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mouse.cpp b/mouse.cpp index bdefbe3c..e60aaffe 100644 --- a/mouse.cpp +++ b/mouse.cpp @@ -385,6 +385,15 @@ void GraphicsWindow::MouseRightUp(double x, double y) { } } + if(gs.n == 0 && gs.constraints == 0 && + (hover.constraint.v && + SK.GetConstraint(hover.constraint)->type == Constraint::COMMENT) || + (hover.entity.v && + SK.GetEntity(hover.entity)->IsPoint())) + { + AddContextMenuItem("Snap to Grid", CMNU_SNAP_TO_GRID); + } + if(gs.n > 0 || gs.constraints > 0) { AddContextMenuItem(NULL, CONTEXT_SEPARATOR); AddContextMenuItem("Delete Selection", CMNU_DELETE_SEL); @@ -420,6 +429,11 @@ void GraphicsWindow::MouseRightUp(double x, double y) { Constraint::MenuConstrain(MNU_OTHER_ANGLE); break; + case CMNU_SNAP_TO_GRID: + ToggleSelectionStateOfHovered(); + MenuEdit(MNU_SNAP_TO_GRID); + break; + case CMNU_GROUP_INFO: { if(toggleForGroupInfo) ToggleSelectionStateOfHovered(); diff --git a/solvespace.cpp b/solvespace.cpp index ed54e3e3..0deca456 100644 --- a/solvespace.cpp +++ b/solvespace.cpp @@ -753,7 +753,7 @@ void SolveSpace::MenuHelp(int id) { break; case GraphicsWindow::MNU_ABOUT: - Message("This is SolveSpace version 1.4.\r\n\r\n" + Message("This is SolveSpace version 1.5.\r\n\r\n" "For more information, see http://www.solvespace.com/\r\n\r\n" "Built " __TIME__ " " __DATE__ ".\r\n\r\n" "Copyright 2008-2009 Useful Subset, LLC. All Rights Reserved."); diff --git a/ui.h b/ui.h index 0c94947c..79e15e51 100644 --- a/ui.h +++ b/ui.h @@ -453,6 +453,7 @@ public: static const int CMNU_REFERENCE_DIM = 0x106; static const int CMNU_OTHER_ANGLE = 0x107; static const int CMNU_STYLE_INFO = 0x108; + static const int CMNU_SNAP_TO_GRID = 0x109; static const int CMNU_FIRST_STYLE = 0x40000000; void ContextMenuListStyles(void); diff --git a/wishlist.txt b/wishlist.txt index b3ec76c0..8a4ce736 100644 --- a/wishlist.txt +++ b/wishlist.txt @@ -2,6 +2,7 @@ multi-drag ----- +some kind of import wireframe export faster triangulation interpolating splines