Update text rendering.

This commit is contained in:
jmsgrogan 2023-01-18 17:31:16 +00:00
parent 8536908eab
commit 8130308f7f
27 changed files with 503 additions and 77 deletions

View file

@ -2,7 +2,7 @@
struct Bounds
{
Bounds(double minX, double maxX, double minY, double maxY, double minZ = 0.0, double maxZ = 0.0)
Bounds(double minX = 0.0, double maxX = 0.0, double minY = 0.0, double maxY = 0.0, double minZ = 0.0, double maxZ = 0.0)
: mMinX(minX),
mMaxX(maxX),
mMinY(minY),
@ -60,4 +60,21 @@ struct Bounds
mMaxZ = z;
}
}
bool operator==(const Bounds& rhs) const
{
return (mMinX == rhs.mMinX)
&& (mMaxX == rhs.mMaxX)
&& (mMinY == rhs.mMinY)
&& (mMaxY == rhs.mMaxY)
&& (mMinZ == rhs.mMinZ)
&& (mMaxZ == rhs.mMaxZ);
}
bool operator!=(const Bounds& rhs) const
{
return !operator==(rhs);
}
};

View file

@ -31,6 +31,21 @@ public:
return !operator==(rhs);
}
bool hasDefaultLocation() const
{
return mLocation.getX() == 0.0 && mLocation.getY() == 0.0 && mLocation.getZ() == 0.0;
}
bool hasDefaultScale() const
{
return mScaleX == 1.0 && mScaleY == 1.0 && mScaleZ == 1.0;
}
bool isDefaultTransform() const
{
return hasDefaultLocation() && hasDefaultScale();
}
private:
Point mLocation;
double mScaleX{1};