//==============================================================================
void DrawableText::refreshFromValueTree (const ValueTree& tree, ComponentBuilder&)
{
    ValueTreeWrapper v (tree);
    setComponentID (v.getID());

    const RelativeParallelogram newBounds (v.getBoundingBox());
    const RelativePoint newFontPoint (v.getFontSizeControlPoint());
    const Colour newColour (v.getColour());
    const Justification newJustification (v.getJustification());
    const String newText (v.getText());
    const Font newFont (v.getFont());

    if (text != newText || font != newFont || justification != newJustification
         || colour != newColour || bounds != newBounds || newFontPoint != fontSizeControlPoint)
    {
        setBoundingBox (newBounds);
        setFontSizeControlPoint (newFontPoint);
        setColour (newColour);
        setFont (newFont, false);
        setJustification (newJustification);
        setText (newText);
    }
}