[bugs:#2179] Win32: ListBoxX::GetDesiredRect should use correct technology to measure width
Status: open
Group: Bug
Created: Sun May 31, 2020 08:30 AM UTC by mberchtold
Last Updated: Sun May 31, 2020 08:30 AM UTC
Owner: nobody
In ListBoxX::GetDesiredRect, GDI (GetTextExtentPoint32) is always used to measure the text width. This should depend on the technology class member. If it is not SCWIN_TECH_GDI, then D2D should be used. This would be consistent with the code in ListBoxX::Draw. Right now the text is measure width GDI but drawn with D2D. The text width might be incorrect as D2D and GDI (may) use different text render implementations.
The text measurement implementation for D2D can be taken from SurfaceD2D::WidthText.
Sent from sourceforge.net because scintill...@googlegroups.com is subscribed to https://sourceforge.net/p/scintilla/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/scintilla/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
test is drawn with GDI, not D2D.
if (unicodeMode) { const TextWide tbuf(text, unicodeMode); ::DrawTextW(pDrawItem->hDC, tbuf.buffer, tbuf.tlen, &rcText, DT_NOPREFIX | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOCLIP); } else { ::DrawTextA(pDrawItem->hDC, text, len, &rcText, DT_NOPREFIX | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOCLIP); }
Correct. But the image is drawn with D2D. I think everything should be measured/drawn with D2D if the technlogy is set to D2D.
[bugs:#2179] Win32: ListBoxX::GetDesiredRect should use correct technology to measure width
Status: open
Group: Bug
Created: Sun May 31, 2020 08:30 AM UTC by mberchtold
Last Updated: Sun May 31, 2020 08:35 AM UTC
Owner: nobody
Using DirectWrite for drawing and measuring the text in lists would be reasonable.
[bugs:#2179] Win32: ListBoxX::GetDesiredRect should use correct technology to measure width
Status: open
Group: Bug
Created: Sun May 31, 2020 08:30 AM UTC by mberchtold
Last Updated: Sun May 31, 2020 08:40 AM UTC
Owner: nobody
Fixed in v5.5.6.
[bugs:#2179] Win32: ListBoxX::GetDesiredRect should use correct technology to measure width
Status: closed-fixed
Group: Bug
Labels: Scintilla win32 directwrite
Created: Sun May 31, 2020 08:30 AM UTC by mberchtold
Last Updated: Sun May 31, 2020 10:48 PM UTC
Owner: nobody