diff --git a/windows/attrstr.cpp b/windows/attrstr.cpp index c6d366c5..6c96a8a4 100644 --- a/windows/attrstr.cpp +++ b/windows/attrstr.cpp @@ -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: diff --git a/windows/drawtext.cpp b/windows/drawtext.cpp index 3510a379..67ec0a47 100644 --- a/windows/drawtext.cpp +++ b/windows/drawtext.cpp @@ -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);