Browse Source

DrawableText: Fix applying transformation in getOutlineAsPath()

v7.0.9
attila 2 years ago
parent
commit
6c3ba087f2
2 changed files with 4 additions and 3 deletions
  1. +3
    -2
      modules/juce_gui_basics/drawables/juce_Drawable.cpp
  2. +1
    -1
      modules/juce_gui_basics/drawables/juce_DrawableText.cpp

+ 3
- 2
modules/juce_gui_basics/drawables/juce_Drawable.cpp View File

@@ -137,8 +137,9 @@ void Drawable::setBoundsToEnclose (Rectangle<float> area)
if (auto* parent = getParent())
parentOrigin = parent->originRelativeToComponent;
auto newBounds = area.getSmallestIntegerContainer() + parentOrigin;
originRelativeToComponent = parentOrigin - newBounds.getPosition();
const auto smallestIntegerContainer = area.getSmallestIntegerContainer();
auto newBounds = smallestIntegerContainer + parentOrigin;
originRelativeToComponent = -smallestIntegerContainer.getPosition();
setBounds (newBounds);
updateTransform();
}


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

@@ -194,7 +194,7 @@ Path DrawableText::getOutlineAsPath() const
pathOfAllGlyphs.addPath (gylphPath);
}
pathOfAllGlyphs.applyTransform (getTextTransform (w, h).followedBy (getTransform()));
pathOfAllGlyphs.applyTransform (getTextTransform (w, h).followedBy (drawableTransform));
return pathOfAllGlyphs;
}


Loading…
Cancel
Save