Browse Source

Made sure that Drawable::createCopy copies their names and IDs.

tags/2021-05-28
jules 13 years ago
parent
commit
ecb7abb435
6 changed files with 20 additions and 7 deletions
  1. +6
    -0
      modules/juce_gui_basics/drawables/juce_Drawable.cpp
  2. +6
    -3
      modules/juce_gui_basics/drawables/juce_Drawable.h
  3. +2
    -1
      modules/juce_gui_basics/drawables/juce_DrawableComposite.cpp
  4. +2
    -1
      modules/juce_gui_basics/drawables/juce_DrawableImage.cpp
  5. +2
    -1
      modules/juce_gui_basics/drawables/juce_DrawableShape.cpp
  6. +2
    -1
      modules/juce_gui_basics/drawables/juce_DrawableText.cpp

+ 6
- 0
modules/juce_gui_basics/drawables/juce_Drawable.cpp View File

@@ -29,6 +29,12 @@ Drawable::Drawable()
setPaintingIsUnclipped (true);
}
Drawable::Drawable (const Drawable& other)
{
setName (other.getName());
setComponentID (other.getComponentID());
}
Drawable::~Drawable()
{
}


+ 6
- 3
modules/juce_gui_basics/drawables/juce_Drawable.h View File

@@ -207,11 +207,11 @@ protected:
friend class DrawableShape;
/** @internal */
void transformContextToCorrectOrigin (Graphics& g);
void transformContextToCorrectOrigin (Graphics&);
/** @internal */
void parentHierarchyChanged();
/** @internal */
void setBoundsToEnclose (const Rectangle<float>& area);
void setBoundsToEnclose (const Rectangle<float>&);
Point<int> originRelativeToComponent;
@@ -243,12 +243,15 @@ protected:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Positioner);
};
Drawable (const Drawable&);
#endif
private:
void nonConstDraw (Graphics& g, float opacity, const AffineTransform& transform);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Drawable);
Drawable& operator= (const Drawable&);
JUCE_LEAK_DETECTOR (Drawable);
};


+ 2
- 1
modules/juce_gui_basics/drawables/juce_DrawableComposite.cpp View File

@@ -34,7 +34,8 @@ DrawableComposite::DrawableComposite()
}
DrawableComposite::DrawableComposite (const DrawableComposite& other)
: bounds (other.bounds),
: Drawable (other),
bounds (other.bounds),
markersX (other.markersX),
markersY (other.markersY),
updateBoundsReentrant (false)


+ 2
- 1
modules/juce_gui_basics/drawables/juce_DrawableImage.cpp View File

@@ -32,7 +32,8 @@ DrawableImage::DrawableImage()
}
DrawableImage::DrawableImage (const DrawableImage& other)
: image (other.image),
: Drawable (other),
image (other.image),
opacity (other.opacity),
overlayColour (other.overlayColour),
bounds (other.bounds)


+ 2
- 1
modules/juce_gui_basics/drawables/juce_DrawableShape.cpp View File

@@ -31,7 +31,8 @@ DrawableShape::DrawableShape()
}
DrawableShape::DrawableShape (const DrawableShape& other)
: strokeType (other.strokeType),
: Drawable (other),
strokeType (other.strokeType),
mainFill (other.mainFill),
strokeFill (other.strokeFill)
{


+ 2
- 1
modules/juce_gui_basics/drawables/juce_DrawableText.cpp View File

@@ -34,7 +34,8 @@ DrawableText::DrawableText()
}
DrawableText::DrawableText (const DrawableText& other)
: bounds (other.bounds),
: Drawable (other),
bounds (other.bounds),
fontHeight (other.fontHeight),
fontHScale (other.fontHScale),
font (other.font),


Loading…
Cancel
Save