From 85b4b25278c0acf85c6f35cb347c672f273dec5d Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 16 Apr 2017 02:12:31 +0000 Subject: [PATCH] Fix a crash changing g->meshCombine when g->type!=EXTRUDE. --- CHANGELOG.md | 7 +++++++ src/textscreens.cpp | 16 +++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b84f47..9add68a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,13 @@ Bugs fixed: as a source group also gets forced to triangle mesh. * Paste Transformed with a negative scale does not invert arcs. +2.x +--- + +Bug fixes: + * Do not crash when changing an unconstrained lathe group between + union and difference modes. + 2.3 --- diff --git a/src/textscreens.cpp b/src/textscreens.cpp index 9998583..8be0096 100644 --- a/src/textscreens.cpp +++ b/src/textscreens.cpp @@ -188,13 +188,15 @@ void TextWindow::ScreenChangeGroupOption(int link, uint32_t v) { case 'K': g->skipFirst = false; break; case 'c': - // When an extrude group is first created, it's positioned for a union - // extrusion. If no constraints were added, flip it when we switch between - // union and difference modes to avoid manual work doing the smae. - if(g->meshCombine != (Group::CombineAs)v && g->GetNumConstraints() == 0 && - ((Group::CombineAs)v == Group::CombineAs::DIFFERENCE || - g->meshCombine == Group::CombineAs::DIFFERENCE)) { - g->ExtrusionForceVectorTo(g->ExtrusionGetVector().Negated()); + if(g->type == Group::Type::EXTRUDE) { + // When an extrude group is first created, it's positioned for a union + // extrusion. If no constraints were added, flip it when we switch between + // union and difference modes to avoid manual work doing the smae. + if(g->meshCombine != (Group::CombineAs)v && g->GetNumConstraints() == 0 && + ((Group::CombineAs)v == Group::CombineAs::DIFFERENCE || + g->meshCombine == Group::CombineAs::DIFFERENCE)) { + g->ExtrusionForceVectorTo(g->ExtrusionGetVector().Negated()); + } } g->meshCombine = (Group::CombineAs)v; break;