riched20: The run width is always passed so we don't need to calculate it again.
This commit is contained in:
parent
3b7c3f61bd
commit
941775e311
|
@ -223,7 +223,6 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText,
|
||||||
HGDIOBJ hOldFont;
|
HGDIOBJ hOldFont;
|
||||||
COLORREF rgbOld;
|
COLORREF rgbOld;
|
||||||
int yOffset = 0, yTwipsOffset = 0;
|
int yOffset = 0, yTwipsOffset = 0;
|
||||||
SIZE sz;
|
|
||||||
COLORREF rgb;
|
COLORREF rgb;
|
||||||
HPEN hPen = NULL, hOldPen = NULL;
|
HPEN hPen = NULL, hOldPen = NULL;
|
||||||
BOOL bHighlightedText = (nSelFrom < nChars && nSelTo >= 0
|
BOOL bHighlightedText = (nSelFrom < nChars && nSelTo >= 0
|
||||||
|
@ -255,13 +254,9 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText,
|
||||||
else
|
else
|
||||||
rgb = s->fmt.crTextColor;
|
rgb = s->fmt.crTextColor;
|
||||||
|
|
||||||
/* Determine the area that is selected in the run. */
|
|
||||||
GetTextExtentPoint32W(hDC, szText, nChars, &sz);
|
|
||||||
/* Treat width as an optional parameter. We can get the width from the
|
|
||||||
* text extent of the string if it isn't specified. */
|
|
||||||
if (!width) width = sz.cx;
|
|
||||||
if (bHighlightedText)
|
if (bHighlightedText)
|
||||||
{
|
{
|
||||||
|
SIZE sz;
|
||||||
if (nSelFrom <= 0)
|
if (nSelFrom <= 0)
|
||||||
{
|
{
|
||||||
nSelFrom = 0;
|
nSelFrom = 0;
|
||||||
|
|
Loading…
Reference in New Issue