RotationBy now accepts radians, to be consistent among methods
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14087 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -280,11 +280,11 @@ Transformable::TranslateBy(BPoint offset)
|
||||
|
||||
// RotateBy
|
||||
void
|
||||
Transformable::RotateBy(BPoint origin, double degrees)
|
||||
Transformable::RotateBy(BPoint origin, double radians)
|
||||
{
|
||||
if (degrees != 0.0) {
|
||||
if (radians != 0.0) {
|
||||
multiply(agg::trans_affine_translation(-origin.x, -origin.y));
|
||||
multiply(agg::trans_affine_rotation(degrees * (PI / 180.0)));
|
||||
multiply(agg::trans_affine_rotation(radians));
|
||||
multiply(agg::trans_affine_translation(origin.x, origin.y));
|
||||
TransformationChanged();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class Transformable : public BArchivable,
|
||||
|
||||
// some convenience functions
|
||||
virtual void TranslateBy(BPoint offset);
|
||||
virtual void RotateBy(BPoint origin, double degrees);
|
||||
virtual void RotateBy(BPoint origin, double radians);
|
||||
virtual void ScaleBy(BPoint origin, double xScale, double yScale);
|
||||
virtual void ShearBy(BPoint origin, double xShear, double yShear);
|
||||
|
||||
|
||||
@@ -82,9 +82,8 @@ AGGTextRenderer::SetFont(const ServerFont &font)
|
||||
bool success = true;
|
||||
// construct an embedded transformation (rotate & shear)
|
||||
Transformable transform;
|
||||
// TODO: check if Transformable::ShearBy should accept degrees instead of radians
|
||||
transform.ShearBy(B_ORIGIN, (90.0 - font.Shear()) * PI / 180.0, 0.0);
|
||||
transform.RotateBy(B_ORIGIN, -font.Rotation());
|
||||
transform.RotateBy(B_ORIGIN, -font.Rotation() * PI / 180.0);
|
||||
|
||||
bool load = font.GetFamilyAndStyle() != fLastFamilyAndStyle ||
|
||||
transform != fEmbeddedTransformation;
|
||||
|
||||
Reference in New Issue
Block a user