diff --git a/headers/private/servers/app/LayerData.h b/headers/private/servers/app/LayerData.h index 10968c9b2b..2924896c35 100644 --- a/headers/private/servers/app/LayerData.h +++ b/headers/private/servers/app/LayerData.h @@ -51,6 +51,9 @@ class DrawData { DrawData(const DrawData& from); virtual ~DrawData(); + // NOTE: this operator will not make a 1:1 copy, it is used + // for the state stack and therefor origin and scale are reset + // to B_ORIGIN and 1.0. DrawData& operator=(const DrawData& from); // coordinate transformation @@ -155,13 +158,16 @@ class DrawData { float fPenSize; ServerFont fFont; +// TODO: Remove, see above bool fFontAntiAliasing; escapement_delta fEscapementDelta; +// cap_mode fLineCapMode; join_mode fLineJoinMode; float fMiterLimit; - + // "internal", used to calculate the size + // of the font (again) when the scale changes float fUnscaledFontSize; }; diff --git a/src/servers/app/LayerData.cpp b/src/servers/app/LayerData.cpp index 96f09b4423..6738064aa9 100644 --- a/src/servers/app/LayerData.cpp +++ b/src/servers/app/LayerData.cpp @@ -81,8 +81,16 @@ DrawData::~DrawData() DrawData& DrawData::operator=(const DrawData& from) { - fOrigin = from.fOrigin; - fScale = from.fScale; + // NOTE: This function is intended for use by the Layer + // state stack only. + // So it does not make a true copy of the DrawData, but resets + // fOrigin and fScale and uses the current the font size as + // fUnscaledFontSize. + +// fOrigin = from.fOrigin; +// fScale = from.fScale; + fOrigin = BPoint(0.0, 0.0); + fScale = 1.0; if (from.fClippingRegion) { SetClippingRegion(*(from.fClippingRegion)); @@ -110,7 +118,11 @@ DrawData::operator=(const DrawData& from) fLineJoinMode = from.fLineJoinMode; fMiterLimit = from.fMiterLimit; - fUnscaledFontSize = from.fUnscaledFontSize; +// fUnscaledFontSize = from.fUnscaledFontSize; + // Since fScale is reset to 1.0, the unscaled + // font size is the current size of the font + // (which is from.fFont.Size() * from.fScale) + fUnscaledFontSize = fFont.Size(); return *this; }