BView: add methods for affine translation/scaling/rotation

* BView::TranslateBy(), BView::ScaleBy() and BView::RotateBy()
  allow to conveniently modify the current affine transformation.
  This makes it unnecessary to first read the current transform,
  modify it, and then set it again.
  Uses the new Pre...() methods of BAffineTransform.

* Also, remove setting the transform "through" to the BView even
  while recording a BPicture, as this now results in transforms
  being applied more than once.
This commit is contained in:
Julian Harnath
2015-11-10 23:34:08 +01:00
parent 4721524cb5
commit 25dbf74b8e
13 changed files with 301 additions and 4 deletions
@@ -41,6 +41,9 @@ public:
const float& miterLimit);
status_t WriteSetScale(const float& scale);
status_t WriteSetTransform(BAffineTransform transform);
status_t WriteTranslateBy(double x, double y);
status_t WriteScaleBy(double x, double y);
status_t WriteRotateBy(double angleRadians);
status_t WriteSetPattern(const ::pattern& pattern);
status_t WriteClipToPicture(int32 pictureToken,
const BPoint& origin, bool inverse);