From 03928b4b1a16e47aff607bdf8729959cc02cbc0f Mon Sep 17 00:00:00 2001 From: zeljko Date: Thu, 12 Mar 2015 14:52:05 +0000 Subject: [PATCH] Qt: fixed text drawing when NO_CLIP flag is present. issue #27631 git-svn-id: trunk@48298 - --- lcl/interfaces/qt/qtwinapi.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lcl/interfaces/qt/qtwinapi.inc b/lcl/interfaces/qt/qtwinapi.inc index 2e9d13cfba..bbc3ddbc56 100644 --- a/lcl/interfaces/qt/qtwinapi.inc +++ b/lcl/interfaces/qt/qtwinapi.inc @@ -1365,16 +1365,16 @@ begin B := QtDC.getClipping; - if B and - (Flags and DT_NOCLIP = DT_NOCLIP) and + if (Flags and DT_NOCLIP = DT_NOCLIP) and (Flags and DT_WORDBREAK = DT_WORDBREAK) then begin - ClipRect := QtDC.getClipRegion.getBoundingRect; + if B then + ClipRect := QtDC.getClipRegion.getBoundingRect; //this is just to get same behaviour as gtk2 and win32 //IMO, we should change ARect.Left and/or ARect.Top if smaller than //clip rect (map to clipRect). Then multiline text is drawn ok. //look at issue http://bugs.freepascal.org/view.php?id=17678 . zeljko. - if (ARect.Left < ClipRect.Left) or (ARect.Top < ClipRect.Top) then + if not B or (B and ((ARect.Left < ClipRect.Left) or (ARect.Top < ClipRect.Top))) then begin {$note remove ifdef if I'm wrong about DT_WORDBREAK OBSERVATION} {$IFDEF QT_DRAWTEXT_MAP_TO_CLIPRECT}