1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

DrawableText: Fix applying transformation in getOutlineAsPath()

This commit is contained in:
attila 2023-10-06 17:06:02 +02:00
parent 158220ddfa
commit 6c3ba087f2
2 changed files with 4 additions and 3 deletions

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();
}

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;
}