void DrawableShape::strokeChanged() { strokePath.clear(); strokeType.createStrokedPath (strokePath, path, AffineTransform::identity, 4.0f); setBoundsToEnclose (getDrawableBounds()); repaint(); }
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(); }
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(); }
void Drawable::parentHierarchyChanged() { setBoundsToEnclose (getDrawableBounds()); }