The scale of a state does not influence the origin. Only previous states

and their origin and scale influences the current state's origin, since
they can be regarded as within the parent state's coordinate system.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24740 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-04-02 11:04:03 +00:00
parent 0aee496bd0
commit 42cf275606
+3 -2
View File
@@ -289,8 +289,7 @@ DrawState::SetOrigin(const BPoint& origin)
fCombinedOrigin.y = fPreviousState->fCombinedOrigin.y
+ fOrigin.y * fPreviousState->fCombinedScale;
} else {
fCombinedOrigin.x = fOrigin.x * fCombinedScale;
fCombinedOrigin.y = fOrigin.y * fCombinedScale;
fCombinedOrigin = fOrigin;
}
}
@@ -309,6 +308,8 @@ DrawState::SetScale(float scale)
fCombinedScale = fScale;
// update font size
// NOTE: This is what makes the call potentially expensive,
// hence the introductory check
fFont.SetSize(fUnscaledFontSize * fCombinedScale);
}
}