Bug 161161

Summary: Subscripts in X axis label reduce margin size
Product: [Applications] kst Reporter: Netterfield <netterfield>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Netterfield 2008-04-22 17:35:36 UTC
Version:           1.7.0_devel (using 3.5.8, Kubuntu (gutsy) 4:3.5.8-0ubuntu3.3)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.22-14-generic

Create a plot (plots -> new)
On Create an x axis label (eg "Test Label")
Note the size of the bottom margin (it is enough to fit the label)

Now change the X label to "Test Label_x".
Note that the bottom margin shrinks, so that the label runs into the X tick labels.


What should happen?
The bottom margin should instead grow to make room for the new taller label.
Comment 1 Andrew Walker 2008-04-22 22:33:42 UTC
This problem is caused by the introduction of _lineSpacing to RenderContext in revision 519035. 

The _lineSpacing member simply holds the line spacing of the last font set for a label. For simple labels, which do not support subscripts and superscripts, this makes sense. For labels that do support subscripts and superscripts _lineSpacing is essentially useless as it may be the line spacing of the main font or of the super/subscript font.

The solution is not to refer to lineSpacing() for x, y, top, etc labels.
Comment 2 Andrew Walker 2008-04-22 23:45:53 UTC
SVN commit 799931 by arwalker:

BUG:161161 fix structure of line spacing of labels

 M  +1 -0      kst2dplot.cpp  
 M  +6 -2      kstplotlabel.cpp  
 M  +3 -5      kstplotlabel.h  
 M  +2 -2      labelrenderer.cpp  
 M  +4 -11     labelrenderer.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=799931