1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Replaced some uses of AffineTransform::identity with a default-constructed object

This commit is contained in:
jules 2015-12-22 17:46:31 +00:00
parent 21d42f346f
commit edec7b34b2
22 changed files with 55 additions and 49 deletions

View file

@ -219,11 +219,9 @@ AffineTransform AffineTransform::inverted() const noexcept
return AffineTransform (dst00, dst01, -mat02 * dst00 - mat12 * dst01,
dst10, dst11, -mat02 * dst10 - mat12 * dst11);
}
else
{
// singularity..
return *this;
}
// singularity..
return *this;
}
bool AffineTransform::isSingularity() const noexcept

View file

@ -71,8 +71,8 @@ public:
transformations to.
e.g. @code
AffineTransform myTransform = AffineTransform::identity.rotated (.5f)
.scaled (2.0f);
AffineTransform myTransform = AffineTransform().rotated (.5f)
.scaled (2.0f);
@endcode
*/
static const AffineTransform identity;

View file

@ -981,7 +981,7 @@ AffineTransform Path::getTransformToScaleToFit (const float x, const float y,
if (preserveProportions)
{
if (w <= 0 || h <= 0 || boundsRect.isEmpty())
return AffineTransform::identity;
return AffineTransform();
float newW, newH;
const float srcRatio = boundsRect.getHeight() / boundsRect.getWidth();
@ -1030,7 +1030,7 @@ bool Path::contains (const float x, const float y, const float tolerance) const
|| y <= bounds.pathYMin || y >= bounds.pathYMax)
return false;
PathFlatteningIterator i (*this, AffineTransform::identity, tolerance);
PathFlatteningIterator i (*this, AffineTransform(), tolerance);
int positiveCrossings = 0;
int negativeCrossings = 0;
@ -1062,7 +1062,7 @@ bool Path::contains (const Point<float> point, const float tolerance) const
bool Path::intersectsLine (const Line<float>& line, const float tolerance)
{
PathFlatteningIterator i (*this, AffineTransform::identity, tolerance);
PathFlatteningIterator i (*this, AffineTransform(), tolerance);
Point<float> intersection;
while (i.next())
@ -1085,7 +1085,7 @@ Line<float> Path::getClippedLine (const Line<float>& line, const bool keepSectio
}
else
{
PathFlatteningIterator i (*this, AffineTransform::identity);
PathFlatteningIterator i (*this, AffineTransform());
Point<float> intersection;
while (i.next())

View file

@ -158,7 +158,7 @@ public:
/** Returns the length of the path.
@see getPointAlongPath
*/
float getLength (const AffineTransform& transform = AffineTransform::identity) const;
float getLength (const AffineTransform& transform = AffineTransform()) const;
/** Returns a point that is the specified distance along the path.
If the distance is greater than the total length of the path, this will return the
@ -166,7 +166,7 @@ public:
@see getLength
*/
Point<float> getPointAlongPath (float distanceFromStart,
const AffineTransform& transform = AffineTransform::identity) const;
const AffineTransform& transform = AffineTransform()) const;
/** Finds the point along the path which is nearest to a given position.
This sets pointOnPath to the nearest point, and returns the distance of this point from the start
@ -174,7 +174,7 @@ public:
*/
float getNearestPoint (const Point<float> targetPoint,
Point<float>& pointOnPath,
const AffineTransform& transform = AffineTransform::identity) const;
const AffineTransform& transform = AffineTransform()) const;
//==============================================================================
/** Removes all lines and curves, resetting the path completely. */

View file

@ -52,7 +52,7 @@ public:
less lines, so can be generated faster, but will be less smooth.
*/
PathFlatteningIterator (const Path& path,
const AffineTransform& transform = AffineTransform::identity,
const AffineTransform& transform = AffineTransform(),
float tolerance = defaultTolerance);
/** Destructor. */

View file

@ -695,7 +695,7 @@ void PathStrokeType::createDashedStroke (Path& destPath,
if (isSolid && ! first)
newDestPath.lineTo (it.x2, it.y2);
createStrokedPath (destPath, newDestPath, AffineTransform::identity, extraAccuracy);
createStrokedPath (destPath, newDestPath, AffineTransform(), extraAccuracy);
return;
}

View file

@ -104,7 +104,7 @@ public:
*/
void createStrokedPath (Path& destPath,
const Path& sourcePath,
const AffineTransform& transform = AffineTransform::identity,
const AffineTransform& transform = AffineTransform(),
float extraAccuracy = 1.0f) const;
@ -136,7 +136,7 @@ public:
const Path& sourcePath,
const float* dashLengths,
int numDashLengths,
const AffineTransform& transform = AffineTransform::identity,
const AffineTransform& transform = AffineTransform(),
float extraAccuracy = 1.0f) const;
//==============================================================================
@ -163,7 +163,7 @@ public:
const Path& sourcePath,
float arrowheadStartWidth, float arrowheadStartLength,
float arrowheadEndWidth, float arrowheadEndLength,
const AffineTransform& transform = AffineTransform::identity,
const AffineTransform& transform = AffineTransform(),
float extraAccuracy = 1.0f) const;
//==============================================================================