diff --git a/src/apps/icon-o-matic/transformable/ChannelTransform.cpp b/src/apps/icon-o-matic/transformable/ChannelTransform.cpp index ce082863a3..49e95b443d 100644 --- a/src/apps/icon-o-matic/transformable/ChannelTransform.cpp +++ b/src/apps/icon-o-matic/transformable/ChannelTransform.cpp @@ -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 diff --git a/src/apps/icon-o-matic/transformable/ChannelTransform.h b/src/apps/icon-o-matic/transformable/ChannelTransform.h index bb1d70bbf5..f041816cf7 100644 --- a/src/apps/icon-o-matic/transformable/ChannelTransform.h +++ b/src/apps/icon-o-matic/transformable/ChannelTransform.h @@ -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);