Fixed background drawing on Windows.

This commit is contained in:
Pietro Gagliardi 2017-02-22 21:46:15 -05:00
parent f2b158b529
commit 0f2b2b1fe5
2 changed files with 4 additions and 2 deletions

View File

@ -110,12 +110,15 @@ static int processAttribute(uiAttributedString *s, uiAttributeSpec *spec, size_t
struct foreachParams *p = (struct foreachParams *) data;
DWRITE_TEXT_RANGE range;
WCHAR *wfamily;
size_t ostart, oend;
BOOL hasUnderline;
uint32_t vertval;
WCHAR *localeName;
struct otParam op;
HRESULT hr;
ostart = start;
oend = end;
start = attrstrUTF8ToUTF16(s, start);
end = attrstrUTF8ToUTF16(s, end);
range.startPosition = start;
@ -170,7 +173,7 @@ static int processAttribute(uiAttributedString *s, uiAttributeSpec *spec, size_t
break;
case uiAttributeBackground:
p->backgroundFuncs->push_back(
mkBackgroundFunc(start, end,
mkBackgroundFunc(ostart, oend,
spec->R, spec->G, spec->B, spec->A));
break;
case uiAttributeVerticalForms:

View File

@ -500,7 +500,6 @@ void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y)
textRenderer *renderer;
HRESULT hr;
// TODO the "any combination of the above" one isn't drawn in the right place but the "multiple backgrounds" one is (at least for when there's a line break; TODO)
for (const auto &f : *(tl->backgroundFuncs))
f(c, tl, x, y);