//============================================================================== void DrawableImage::setImage (const Image& imageToUse) { image = imageToUse; setBounds (imageToUse.getBounds()); bounds.topLeft = RelativePoint (Point<float> (0.0f, 0.0f)); bounds.topRight = RelativePoint (Point<float> ((float) image.getWidth(), 0.0f)); bounds.bottomLeft = RelativePoint (Point<float> (0.0f, (float) image.getHeight())); recalculateCoordinates (nullptr); repaint(); }
void DrawableText::refreshBounds() { if (bounds.isDynamic() || fontSizeControlPoint.isDynamic()) { Drawable::Positioner<DrawableText>* const p = new Drawable::Positioner<DrawableText> (*this); setPositioner (p); p->apply(); } else { setPositioner (0); recalculateCoordinates (0); } }
void DrawableRectangle::rebuildPath() { if (bounds.isDynamic() || cornerSize.isDynamic()) { Drawable::Positioner<DrawableRectangle>* const p = new Drawable::Positioner<DrawableRectangle> (*this); setPositioner (p); p->apply(); } else { setPositioner (nullptr); recalculateCoordinates (nullptr); } }
void DrawableImage::setBoundingBox (const RelativeParallelogram& newBounds) { if (bounds != newBounds) { bounds = newBounds; if (bounds.isDynamic()) { Drawable::Positioner<DrawableImage>* const p = new Drawable::Positioner<DrawableImage> (*this); setPositioner (p); p->apply(); } else { setPositioner (nullptr); recalculateCoordinates (nullptr); } } }