mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-29 02:40:05 +00:00
Font: Deprecate getStringWidth and getGlyphPositions
This commit is contained in:
parent
eddedc2d13
commit
29213e07a1
21 changed files with 179 additions and 58 deletions
|
|
@ -95,9 +95,14 @@ public:
|
|||
void fitToContent (const int h) noexcept
|
||||
{
|
||||
if (keyNum < 0)
|
||||
{
|
||||
setSize (h, h);
|
||||
}
|
||||
else
|
||||
setSize (jlimit (h * 4, h * 8, 6 + Font (withDefaultMetrics (FontOptions { (float) h * 0.6f })).getStringWidth (getName())), h);
|
||||
{
|
||||
const auto idealWidth = GlyphArrangement::getStringWidthInt (withDefaultMetrics (FontOptions { (float) h * 0.6f }), getName());
|
||||
setSize (jlimit (h * 4, h * 8, 6 + idealWidth), h);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue