diff --git a/src/sketch.h b/src/sketch.h index 26625fe..d9f1794 100644 --- a/src/sketch.h +++ b/src/sketch.h @@ -827,7 +827,7 @@ public: static void CreateAllDefaultStyles(void); static void CreateDefaultStyle(hStyle h); - static void FillDefaultStyle(Style *s, const Default *d = NULL); + static void FillDefaultStyle(Style *s, const Default *d = NULL, bool factory = false); static void FreezeDefaultStyles(void); static void LoadFactoryDefaults(void); diff --git a/src/style.cpp b/src/style.cpp index 91caaea..4d437cd 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -83,12 +83,13 @@ void Style::CreateDefaultStyle(hStyle h) { SK.style.Add(&ns); } -void Style::FillDefaultStyle(Style *s, const Default *d) { +void Style::FillDefaultStyle(Style *s, const Default *d, bool factory) { if(d == NULL) d = &Defaults[0]; - s->color = CnfThawColor(d->color, CnfColor(d->cnfPrefix)); - s->width = CnfThawFloat((float)(d->width), CnfWidth(d->cnfPrefix)); + s->color = (factory) ? d->color : CnfThawColor(d->color, CnfColor(d->cnfPrefix)); + s->width = (factory) ? d->width : CnfThawFloat((float)(d->width), CnfWidth(d->cnfPrefix)); s->widthAs = UNITS_AS_PIXELS; - s->textHeight = CnfThawFloat(DEFAULT_TEXT_HEIGHT, CnfTextHeight(d->cnfPrefix)); + s->textHeight = (factory) ? DEFAULT_TEXT_HEIGHT + : CnfThawFloat(DEFAULT_TEXT_HEIGHT, CnfTextHeight(d->cnfPrefix)); s->textHeightAs = UNITS_AS_PIXELS; s->textOrigin = 0; s->textAngle = 0; @@ -106,7 +107,7 @@ void Style::LoadFactoryDefaults(void) { const Default *d; for(d = &(Defaults[0]); d->h.v; d++) { Style *s = Get(d->h); - FillDefaultStyle(s, d); + FillDefaultStyle(s, d, /*factory=*/true); } SS.backgroundColor = RGBi(0, 0, 0); if(SS.bgImage.fromFile) MemFree(SS.bgImage.fromFile);