diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt index 2862b5f4..204a2981 100644 --- a/res/CMakeLists.txt +++ b/res/CMakeLists.txt @@ -255,6 +255,7 @@ add_resources( icons/graphics-window/pointonx.png icons/graphics-window/point.png icons/graphics-window/rectangle.png + icons/graphics-window/relation.png icons/graphics-window/ref.png icons/graphics-window/revolve.png icons/graphics-window/same-orientation.png diff --git a/res/icons/graphics-window/relation.png b/res/icons/graphics-window/relation.png new file mode 100644 index 00000000..e60900c1 Binary files /dev/null and b/res/icons/graphics-window/relation.png differ diff --git a/src/drawconstraint.cpp b/src/drawconstraint.cpp index 3facb662..a62e6c01 100644 --- a/src/drawconstraint.cpp +++ b/src/drawconstraint.cpp @@ -28,9 +28,9 @@ std::string Constraint::Label() const { } if(expression != "") { result = expression ; - if(SS.MmPerUnit() != expr_scaling_to_base) { - result += "*" + std::to_string(expr_scaling_to_base/SS.MmPerUnit()); - } + if(SS.MmPerUnit() != expr_scaling_to_base && expr_scaling_to_base != 0) { + result += "*" + std::to_string(expr_scaling_to_base/SS.MmPerUnit()); + } } if(reference) { result += " REF"; diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index e2a252db..7f793d16 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -165,7 +165,7 @@ const MenuEntry Menu[] = { { 1, N_("Lock Point Where &Dragged"), Command::WHERE_DRAGGED, ']', KN, mCon }, { 1, NULL, Command::NONE, 0, KN, NULL }, { 1, N_("Comment"), Command::COMMENT, ';', KN, mCon }, -{ 1, N_("Relation"), Command::RELATION, ':', KN, mCon }, +{ 1, N_("Relation"), Command::RELATION, '/', KN, mCon }, { 0, N_("&Analyze"), Command::NONE, 0, KN, mAna }, { 1, N_("Measure &Volume"), Command::VOLUME, C|S|'v', KN, mAna }, diff --git a/src/toolbar.cpp b/src/toolbar.cpp index 74764883..6152a541 100644 --- a/src/toolbar.cpp +++ b/src/toolbar.cpp @@ -62,6 +62,8 @@ static ToolIcon Toolbar[] = { N_("Other supplementary angle"), {} }, { "ref", Command::REFERENCE, N_("Toggle reference dimension"), {} }, + { "relation", Command::RELATION, + N_("Constrain variables with equation"), {} }, { "", Command::NONE, "", {} }, { "extrude", Command::GROUP_EXTRUDE,