Preparation of more correct support for state stack.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13201 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -51,6 +51,9 @@ class DrawData {
|
|||||||
DrawData(const DrawData& from);
|
DrawData(const DrawData& from);
|
||||||
virtual ~DrawData();
|
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);
|
DrawData& operator=(const DrawData& from);
|
||||||
|
|
||||||
// coordinate transformation
|
// coordinate transformation
|
||||||
@@ -155,13 +158,16 @@ class DrawData {
|
|||||||
float fPenSize;
|
float fPenSize;
|
||||||
|
|
||||||
ServerFont fFont;
|
ServerFont fFont;
|
||||||
|
// TODO: Remove, see above
|
||||||
bool fFontAntiAliasing;
|
bool fFontAntiAliasing;
|
||||||
escapement_delta fEscapementDelta;
|
escapement_delta fEscapementDelta;
|
||||||
|
//
|
||||||
|
|
||||||
cap_mode fLineCapMode;
|
cap_mode fLineCapMode;
|
||||||
join_mode fLineJoinMode;
|
join_mode fLineJoinMode;
|
||||||
float fMiterLimit;
|
float fMiterLimit;
|
||||||
|
// "internal", used to calculate the size
|
||||||
|
// of the font (again) when the scale changes
|
||||||
float fUnscaledFontSize;
|
float fUnscaledFontSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -81,8 +81,16 @@ DrawData::~DrawData()
|
|||||||
DrawData&
|
DrawData&
|
||||||
DrawData::operator=(const DrawData& from)
|
DrawData::operator=(const DrawData& from)
|
||||||
{
|
{
|
||||||
fOrigin = from.fOrigin;
|
// NOTE: This function is intended for use by the Layer
|
||||||
fScale = from.fScale;
|
// 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) {
|
if (from.fClippingRegion) {
|
||||||
SetClippingRegion(*(from.fClippingRegion));
|
SetClippingRegion(*(from.fClippingRegion));
|
||||||
@@ -110,7 +118,11 @@ DrawData::operator=(const DrawData& from)
|
|||||||
fLineJoinMode = from.fLineJoinMode;
|
fLineJoinMode = from.fLineJoinMode;
|
||||||
fMiterLimit = from.fMiterLimit;
|
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;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user