diff --git a/src/sketch.h b/src/sketch.h index bda0a983..74111d18 100644 --- a/src/sketch.h +++ b/src/sketch.h @@ -924,6 +924,7 @@ public: static double StippleScale(hStyle hs); static double StippleScaleMm(hStyle hs); static std::string StipplePatternName(hStyle hs); + static std::string StipplePatternName(StipplePattern stippleType); static StipplePattern StipplePatternFromString(std::string name); std::string DescriptionString() const; diff --git a/src/style.cpp b/src/style.cpp index b4ed841e..b1070cdc 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -114,7 +114,8 @@ void Style::FillDefaultStyle(Style *s, const Default *d, bool factory) { s->stippleType = (factory) ? d->stippleType : Style::StipplePatternFromString( - settings->ThawString(CnfStippleType(d->cnfPrefix), "")); + settings->ThawString(CnfStippleType(d->cnfPrefix), + StipplePatternName(d->stippleType))); s->stippleScale = (factory) ? 15.0 : settings->ThawFloat(CnfStippleScale(d->cnfPrefix), 15.0); @@ -397,7 +398,11 @@ StipplePattern Style::PatternType(hStyle hs) { std::string Style::StipplePatternName(hStyle hs) { Style *s = Get(hs); - switch(s->stippleType) { + return StipplePatternName(s->stippleType); +} + +std::string Style::StipplePatternName(StipplePattern stippleType) { + switch(stippleType) { case StipplePattern::CONTINUOUS: return "Continuous"; case StipplePattern::SHORT_DASH: return "ShortDash"; case StipplePattern::DASH: return "Dash"; @@ -409,10 +414,9 @@ std::string Style::StipplePatternName(hStyle hs) { case StipplePattern::ZIGZAG: return "ZigZag"; } - return "CONTINUOUS"; + return "Continuous"; } - double Style::StippleScale(hStyle hs) { Style *s = Get(hs); return s->stippleScale;