mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-01 03:10:06 +00:00
DrawableImage: Remove a message thread dependency
This commit is contained in:
parent
efd0373525
commit
8ce68447bb
4 changed files with 31 additions and 24 deletions
|
|
@ -40,6 +40,11 @@ DrawableImage::DrawableImage (const DrawableImage& other)
|
|||
setBounds (other.getBounds());
|
||||
}
|
||||
|
||||
DrawableImage::DrawableImage (const Image& imageToUse)
|
||||
{
|
||||
setImageInternal (imageToUse);
|
||||
}
|
||||
|
||||
DrawableImage::~DrawableImage()
|
||||
{
|
||||
}
|
||||
|
|
@ -52,13 +57,8 @@ std::unique_ptr<Drawable> DrawableImage::createCopy() const
|
|||
//==============================================================================
|
||||
void DrawableImage::setImage (const Image& imageToUse)
|
||||
{
|
||||
if (image != imageToUse)
|
||||
{
|
||||
image = imageToUse;
|
||||
setBounds (image.getBounds());
|
||||
setBoundingBox (image.getBounds().toFloat());
|
||||
if (setImageInternal (imageToUse))
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
|
||||
void DrawableImage::setOpacity (const float newOpacity)
|
||||
|
|
@ -133,6 +133,20 @@ Path DrawableImage::getOutlineAsPath() const
|
|||
return {}; // not applicable for images
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool DrawableImage::setImageInternal (const Image& imageToUse)
|
||||
{
|
||||
if (image != imageToUse)
|
||||
{
|
||||
image = imageToUse;
|
||||
setBounds (image.getBounds());
|
||||
setBoundingBox (image.getBounds().toFloat());
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
std::unique_ptr<AccessibilityHandler> DrawableImage::createAccessibilityHandler()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue