View Issue Details

IDProjectCategoryView StatusLast Update
0026090LazarusLCLpublic2014-04-29 09:12
ReporterBoris Popov Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx64OSUbuntu 12.04 
Product Version1.3 (SVN) 
Summary0026090: Incorrect line spacing in the GTK2 winapi
DescriptionDrawText() function in the GTK2 winapi incorrectly uses font metrics to determine interline spacing. As result, all text drawn with DT_WORDWRAP flag set have too much of vertical spacing. Minimal patch attached.
TagsNo tags attached.
Fixed in Revision44842
LazTarget-
WidgetsetGTK 2
Attached Files

Activities

Boris Popov

2014-04-29 07:54

reporter  

gtk2winapi.diff (954 bytes)   
Index: gtk2winapi.inc
===================================================================
--- gtk2winapi.inc	(revision 44840)
+++ gtk2winapi.inc	(working copy)
@@ -2500,7 +2500,7 @@
       theRect.Right := theRect.Left + LineWidth;
       theRect.Bottom := theRect.Top + NumLines*TM.tmHeight;
       if NumLines>1 then
-        Inc(theRect.Bottom, (NumLines-1)*TM.tmDescent);// space between lines
+        Inc(theRect.Bottom, (NumLines-1)*TM.tmExternalLeading);// space between lines
 
       //debugln('TGtk2WidgetSet.DrawText A ',dbgs(theRect),' TM.tmHeight=',dbgs(TM.tmHeight),' LineWidth=',dbgs(LineWidth),' NumLines=',dbgs(NumLines));
     end;
@@ -2759,7 +2759,7 @@
         DrawLine(Lines[i], l, theRect.Top);
         dec(pIndex,l+length(LineEnding));
       end;
-      Inc(theRect.Top, TM.tmDescent + TM.tmHeight);// space between lines
+      Inc(theRect.Top, TM.tmExternalLeading + TM.tmHeight);// space between lines
     end;
 
   finally
gtk2winapi.diff (954 bytes)   

Zeljan Rikalo

2014-04-29 08:17

developer   ~0074650

Thanks for the patch. I would like to add you to the contributors list (if you're not already there), but you must provide name + surname for this.
Please test and close if ok.

Boris Popov

2014-04-29 09:11

reporter   ~0074653

Works fine, thanks. Real name has been updated.

Boris Popov

2014-04-29 09:12

reporter   ~0074654

Fixed in svn.

Issue History

Date Modified Username Field Change
2014-04-29 07:54 Boris Popov New Issue
2014-04-29 07:54 Boris Popov File Added: gtk2winapi.diff
2014-04-29 07:57 Zeljan Rikalo Assigned To => Zeljan Rikalo
2014-04-29 07:57 Zeljan Rikalo Status new => assigned
2014-04-29 08:17 Zeljan Rikalo Fixed in Revision => 44842
2014-04-29 08:17 Zeljan Rikalo LazTarget => -
2014-04-29 08:17 Zeljan Rikalo Note Added: 0074650
2014-04-29 08:17 Zeljan Rikalo Status assigned => resolved
2014-04-29 08:17 Zeljan Rikalo Resolution open => fixed
2014-04-29 09:11 Boris Popov Note Added: 0074653
2014-04-29 09:12 Boris Popov Note Added: 0074654
2014-04-29 09:12 Boris Popov Status resolved => closed