Пример #1
0
void DrawableShape::strokeChanged()
{
    strokePath.clear();
    strokeType.createStrokedPath (strokePath, path, AffineTransform::identity, 4.0f);

    setBoundsToEnclose (getDrawableBounds());
    repaint();
}
Пример #2
0
void DrawableText::recalculateCoordinates (Expression::Scope* scope)
{
    bounds.resolveThreePoints (resolvedPoints, scope);

    const float w = Line<float> (resolvedPoints[0], resolvedPoints[1]).getLength();
    const float h = Line<float> (resolvedPoints[0], resolvedPoints[2]).getLength();

    const float height = jlimit (0.01f, jmax (0.01f, h), (float) fontHeight.resolve (scope));
    const float hscale = jlimit (0.01f, jmax (0.01f, w), (float) fontHScale.resolve (scope));

    scaledFont = font;
    scaledFont.setHeight (height);
    scaledFont.setHorizontalScale (hscale);

    setBoundsToEnclose (getDrawableBounds());
    repaint();
}
Пример #3
0
void DrawableText::recalculateCoordinates (Expression::Scope* scope)
{
    bounds.resolveThreePoints (resolvedPoints, scope);

    const float w = Line<float> (resolvedPoints[0], resolvedPoints[1]).getLength();
    const float h = Line<float> (resolvedPoints[0], resolvedPoints[2]).getLength();

    const Point<float> fontCoords (RelativeParallelogram::getInternalCoordForPoint (resolvedPoints, fontSizeControlPoint.resolve (scope)));
    const float fontHeight = jlimit (0.01f, jmax (0.01f, h), fontCoords.getY());
    const float fontWidth = jlimit (0.01f, jmax (0.01f, w), fontCoords.getX());

    scaledFont = font;
    scaledFont.setHeight (fontHeight);
    scaledFont.setHorizontalScale (fontWidth / fontHeight);

    setBoundsToEnclose (getDrawableBounds());
    repaint();
}
Пример #4
0
void Drawable::parentHierarchyChanged()
{
    setBoundsToEnclose (getDrawableBounds());
}