Nikolay Sivov : dwrite: Invalidate layout on box changes.

Alexandre Julliard julliard at winehq.org
Thu Jan 26 14:53:13 CST 2017


Module: wine
Branch: master
Commit: 3871981e3abf0d494e9c3811e2ff1d405535f95a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3871981e3abf0d494e9c3811e2ff1d405535f95a

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Jan 26 07:41:48 2017 +0300

dwrite: Invalidate layout on box changes.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dwrite/layout.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index 7ef050e..a80c49e 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -2833,26 +2833,36 @@ static HRESULT WINAPI dwritetextlayout_GetLocaleName(IDWriteTextLayout3 *iface,
 static HRESULT WINAPI dwritetextlayout_SetMaxWidth(IDWriteTextLayout3 *iface, FLOAT maxWidth)
 {
     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout3(iface);
+    BOOL changed;
 
     TRACE("(%p)->(%.2f)\n", This, maxWidth);
 
     if (maxWidth < 0.0f)
         return E_INVALIDARG;
 
+    changed = This->metrics.layoutWidth != maxWidth;
     This->metrics.layoutWidth = maxWidth;
+
+    if (changed)
+        This->recompute |= RECOMPUTE_LINES;
     return S_OK;
 }
 
 static HRESULT WINAPI dwritetextlayout_SetMaxHeight(IDWriteTextLayout3 *iface, FLOAT maxHeight)
 {
     struct dwrite_textlayout *This = impl_from_IDWriteTextLayout3(iface);
+    BOOL changed;
 
     TRACE("(%p)->(%.2f)\n", This, maxHeight);
 
     if (maxHeight < 0.0f)
         return E_INVALIDARG;
 
+    changed = This->metrics.layoutHeight != maxHeight;
     This->metrics.layoutHeight = maxHeight;
+
+    if (changed)
+        This->recompute |= RECOMPUTE_LINES;
     return S_OK;
 }
 




More information about the wine-cvs mailing list