Fix compiler warning about hiding Transformable::ScaleBy() by enabled the

ChannelTransform version of ScaleBy() which was commented out in the code.
I have no idea if this code was tested or not, I've added a comment to the
effect. It certainly isn't used in Icon-O-Matic at the moment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37732 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-07-25 08:51:35 +00:00
parent b08f6fd2bc
commit 14d604ddfa
2 changed files with 26 additions and 23 deletions

View File

@ -162,28 +162,29 @@ ChannelTransform::RotateBy(double degrees)
}
//// ScaleBy
////
//// converts a scalation in world coordinates into
//// a combined local scalation and a translation
//void
//ChannelTransform::ScaleBy(BPoint origin, double xScale, double yScale)
//{
// if (xScale == 1.0 && yScale == 1.0)
// return;
// ScaleBy
//
// fXScale *= xScale;
// fYScale *= yScale;
//
// // scale fTranslation
// double xOffset = fTranslation.x - origin.x;
// double yOffset = fTranslation.y - origin.y;
//
// fTranslation.x = origin.x + (xOffset * xScale);
// fTranslation.y = origin.y + (yOffset * yScale);
//
// _UpdateMatrix();
//}
// converts a scalation in world coordinates into
// a combined local scalation and a translation
void
ChannelTransform::ScaleBy(BPoint origin, double xScale, double yScale)
{
// TODO: Untested?
if (xScale == 1.0 && yScale == 1.0)
return;
fXScale *= xScale;
fYScale *= yScale;
// scale fTranslation
double xOffset = fTranslation.x - origin.x;
double yOffset = fTranslation.y - origin.y;
fTranslation.x = origin.x + (xOffset * xScale);
fTranslation.y = origin.y + (yOffset * yScale);
_UpdateMatrix();
}
// ScaleBy
void

View File

@ -32,10 +32,12 @@ class ChannelTransform : public Transformable {
virtual void TranslateBy(BPoint offset);
virtual void RotateBy(BPoint origin, double degrees);
void ScaleBy(double xScale, double yScale);
void RotateBy(double degrees);
virtual void ScaleBy(BPoint origin, double xScale,
double yScale);
void ScaleBy(double xScale, double yScale);
void SetTranslationAndScale(BPoint offset,
double xScale,
double yScale);