mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
GDI+: Add trailing whitespace when measuring text (similar to 32fc794
)
This commit is contained in:
parent
239e61fd14
commit
6e9bc98d0b
@ -181,7 +181,7 @@ bool CanvasGDIP::MeasureTextLinesW(const WCHAR* str, UINT strLen, const TextForm
|
||||
stringFormat.SetTrimming(Gdiplus::StringTrimmingNone);
|
||||
|
||||
const INT stringFormatFlags = stringFormat.GetFormatFlags();
|
||||
stringFormat.SetFormatFlags(Gdiplus::StringFormatFlagsNoClip);
|
||||
stringFormat.SetFormatFlags(Gdiplus::StringFormatFlagsMeasureTrailingSpaces | Gdiplus::StringFormatFlagsNoClip);
|
||||
|
||||
INT linesFilled = 0;
|
||||
const Gdiplus::Status status = m_Graphics->MeasureString(
|
||||
|
@ -101,12 +101,13 @@ void TextFormatGDIP::SetTrimming(bool trim)
|
||||
if (trim)
|
||||
{
|
||||
m_StringFormat.SetTrimming(Gdiplus::StringTrimmingEllipsisCharacter);
|
||||
m_StringFormat.SetFormatFlags(0x0);
|
||||
m_StringFormat.SetFormatFlags(Gdiplus::StringFormatFlagsMeasureTrailingSpaces);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_StringFormat.SetTrimming(Gdiplus::StringTrimmingNone);
|
||||
m_StringFormat.SetFormatFlags(Gdiplus::StringFormatFlagsNoClip | Gdiplus::StringFormatFlagsNoWrap);
|
||||
m_StringFormat.SetFormatFlags(Gdiplus::StringFormatFlagsMeasureTrailingSpaces |
|
||||
Gdiplus::StringFormatFlagsNoClip | Gdiplus::StringFormatFlagsNoWrap);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user