本文整理汇总了C++中AffineTransform::isSingularity方法的典型用法代码示例。如果您正苦于以下问题:C++ AffineTransform::isSingularity方法的具体用法?C++ AffineTransform::isSingularity怎么用?C++ AffineTransform::isSingularity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AffineTransform
的用法示例。
在下文中一共展示了AffineTransform::isSingularity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: recalculateCoordinates
void DrawableComposite::recalculateCoordinates (Expression::Scope* scope)
{
Point<float> resolved[3];
bounds.resolveThreePoints (resolved, scope);
const Rectangle<float> content (getContentArea().resolve (scope));
AffineTransform t (AffineTransform::fromTargetPoints (content.getX(), content.getY(), resolved[0].x, resolved[0].y,
content.getRight(), content.getY(), resolved[1].x, resolved[1].y,
content.getX(), content.getBottom(), resolved[2].x, resolved[2].y));
if (t.isSingularity())
t = AffineTransform::identity;
setTransform (t);
}
示例2: refreshTransformFromBounds
//==============================================================================
void DrawableImage::refreshTransformFromBounds()
{
if (! image.isNull())
{
Point<float> resolved[3];
bounds.resolveThreePoints (resolved, getParent());
const Point<float> tr (resolved[0] + (resolved[1] - resolved[0]) / (float) image.getWidth());
const Point<float> bl (resolved[0] + (resolved[2] - resolved[0]) / (float) image.getHeight());
AffineTransform t (AffineTransform::fromTargetPoints (resolved[0].getX(), resolved[0].getY(),
tr.getX(), tr.getY(),
bl.getX(), bl.getY()));
if (! t.isSingularity())
setTransform (t);
}
}
示例3: recalculateCoordinates
void DrawableImage::recalculateCoordinates (Expression::Scope* scope)
{
if (image.isValid())
{
Point<float> resolved[3];
bounds.resolveThreePoints (resolved, scope);
const Point<float> tr (resolved[0] + (resolved[1] - resolved[0]) / (float) image.getWidth());
const Point<float> bl (resolved[0] + (resolved[2] - resolved[0]) / (float) image.getHeight());
AffineTransform t (AffineTransform::fromTargetPoints (resolved[0].x, resolved[0].y,
tr.x, tr.y,
bl.x, bl.y));
if (t.isSingularity())
t = AffineTransform::identity;
setTransform (t);
}
}