Browse Source

More clean-up on convertToPath in Introjucer

tags/2021-05-28
hogliux 10 years ago
parent
commit
0e97c57322
1 changed files with 21 additions and 16 deletions
  1. +21
    -16
      extras/Introjucer/Source/ComponentEditor/paintelements/jucer_PaintElementText.h

+ 21
- 16
extras/Introjucer/Source/ComponentEditor/paintelements/jucer_PaintElementText.h View File

@@ -331,28 +331,33 @@ public:
void convertToPath()
{
jassert (dynamic_cast<PaintRoutineEditor*> (getParentComponent()) != nullptr);
if (PaintRoutineEditor* parent = dynamic_cast<PaintRoutineEditor*> (getParentComponent()))
{
font = FontPropertyComponent::applyNameToFont (typefaceName, font);
font = FontPropertyComponent::applyNameToFont (typefaceName, font);
const Rectangle<int> r =
getCurrentBounds (Rectangle<int> (((PaintRoutineEditor*) getParentComponent())
->getComponentArea()).withZeroOrigin());
const Rectangle<int> r =
getCurrentBounds (parent->getComponentArea().withZeroOrigin());
GlyphArrangement arr;
arr.addCurtailedLineOfText (font, text,
0.0f, 0.0f, (float) r.getWidth(),
true);
GlyphArrangement arr;
arr.addCurtailedLineOfText (font, text,
0.0f, 0.0f, (float) r.getWidth(),
true);
arr.justifyGlyphs (0, arr.getNumGlyphs(),
(float) r.getX(), (float) r.getY(),
(float) r.getWidth(), (float) r.getHeight(),
justification);
arr.justifyGlyphs (0, arr.getNumGlyphs(),
(float) r.getX(), (float) r.getY(),
(float) r.getWidth(), (float) r.getHeight(),
justification);
Path path;
arr.createPath (path);
Path path;
arr.createPath (path);
convertToNewPathElement (path);
convertToNewPathElement (path);
}
else
{
jassertfalse;
}
}
private:


Loading…
Cancel
Save