Browse Source

Added method AffineTransform::withAbsoluteTranslation

tags/2021-05-28
jules 13 years ago
parent
commit
d9f1b72067
2 changed files with 10 additions and 0 deletions
  1. +6
    -0
      modules/juce_graphics/geometry/juce_AffineTransform.cpp
  2. +4
    -0
      modules/juce_graphics/geometry/juce_AffineTransform.h

+ 6
- 0
modules/juce_graphics/geometry/juce_AffineTransform.cpp View File

@@ -105,6 +105,12 @@ AffineTransform AffineTransform::translation (const float dx, const float dy) no
0, 1.0f, dy);
}
AffineTransform AffineTransform::withAbsoluteTranslation (const float tx, const float ty) const noexcept
{
return AffineTransform (mat00, mat01, tx,
mat10, mat11, ty);
}
AffineTransform AffineTransform::rotated (const float rad) const noexcept
{
const float cosRad = std::cos (rad);


+ 4
- 0
modules/juce_graphics/geometry/juce_AffineTransform.h View File

@@ -133,6 +133,10 @@ public:
static AffineTransform translation (float deltaX,
float deltaY) noexcept;
/** Returns a copy of this transform with the specified translation matrix values. */
AffineTransform withAbsoluteTranslation (float translationX,
float translationY) const noexcept;
/** Returns a transform which is the same as this one followed by a rotation.
The rotation is specified by a number of radians to rotate clockwise, centred around


Loading…
Cancel
Save