https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e98684ed8b034c5ef45ab793c1612771ff44bf52

commit e98684ed8b034c5ef45ab793c1612771ff44bf52
Author:     James Tabor <[email protected]>
AuthorDate: Sat Oct 16 11:16:43 2021 -0500
Commit:     James Tabor <[email protected]>
CommitDate: Sat Oct 16 11:16:43 2021 -0500

    [GDI32] Fix rectangle flag issues.
    
    Fix CORE-17815. Remove dumb dumb code breakers.
---
 win32ss/gdi/gdi32/objects/text.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/win32ss/gdi/gdi32/objects/text.c b/win32ss/gdi/gdi32/objects/text.c
index 799c20f5f72..2a3831aff27 100644
--- a/win32ss/gdi/gdi32/objects/text.c
+++ b/win32ss/gdi/gdi32/objects/text.c
@@ -494,6 +494,22 @@ ExtTextOutW(
 {
     PDC_ATTR pdcattr;
 
+    // Need both, should return a parameter error? No they don't!
+    if ( !lpDx && fuOptions & ETO_PDY )
+        return FALSE;
+
+    // Now sorting out rectangle.
+
+    // Here again, need both.
+    if ( lprc && !(fuOptions & (ETO_CLIPPED|ETO_OPAQUE)) )
+    {
+        lprc = NULL; // No flags, no rectangle.
+    }
+    else if (!lprc) // No rectangle, force clear flags if set and continue.
+    {
+       fuOptions &= ~(ETO_CLIPPED|ETO_OPAQUE);
+    }
+
     if ( !bBypassETOWMF )
     {
         HANDLE_METADC(BOOL,

Reply via email to