[PATCH 3/5] dwrite/layout: Simplify run direction check condition.

Nikolay Sivov nsivov at codeweavers.com
Wed Dec 8 05:10:44 CST 2021


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/dwrite/layout.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index b7ab855d1f1..51fa6cbfbe6 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -1594,10 +1594,9 @@ static HRESULT layout_add_effective_run(struct dwrite_textlayout *layout, const
     run->width = get_cluster_range_width(layout, first_cluster, first_cluster + cluster_count);
     memset(&run->bbox, 0, sizeof(run->bbox));
 
-    /* Check if run direction matches paragraph direction, if it doesn't adjust by
-       run width */
-    if (is_run_rtl(run) ^ is_rtl)
-        run->origin.x = is_rtl ? origin_x - run->width : origin_x + run->width;
+    /* Adjust by run width if direction differs. */
+    if (is_run_rtl(run) != is_rtl)
+        run->origin.x = origin_x + (is_rtl ? -run->width : run->width);
     else
         run->origin.x = origin_x;
 
-- 
2.33.0




More information about the wine-devel mailing list