]> source.dussan.org Git - jgit.git/commit
Use baseline instead of centerline in PlotRenderer 03/37303/2
authorMichael Keppler <michael.keppler@gmx.de>
Fri, 28 Nov 2014 20:21:59 +0000 (21:21 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Sat, 29 Nov 2014 00:30:13 +0000 (01:30 +0100)
commit1a721437808cbf7ae0bcdd1b2e060a69aaf2a16b
tree27c14e2d2103065d403d668d9f57ae4772db4f69
parent147e24a7b224fe6d643bb24100030ff70bfbca35
Use baseline instead of centerline in PlotRenderer

If the text extent height of a to be rendered plot line is odd, then the
SWTPlotRenderer cannot calculate the correct Y position for drawing the
label and draws the label with a 1 pixel offset. SWT text drawing uses
the baseline as Y coordinate. Due to the given centerline API in the
AbstractPlotRenderer the overall calculation of the baseline for SWT is
effectively (height / 2) * 2, thereby rounding all odd heights downward
to the next even number.

This change pushes the division by 2 from the caller into the
implementations of drawText. A corresponding change will be pushed in
the egit repository.

Bug: 450813
Change-Id: I66f4e71873bb8e6f936fde573bbe4c35fe23a022
Signed-off-by: Michael Keppler <michael.keppler@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java