You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2017/12/14 20:19:58 UTC

svn commit: r1818207 - /pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinTextNodeView.java

Author: rwhitcomb
Date: Thu Dec 14 20:19:58 2017
New Revision: 1818207

URL: http://svn.apache.org/viewvc?rev=1818207&view=rev
Log:
PIVOT-850:  One small font placement problem in TextPane (specifically
in the "paint()" code for TextPaneSkinTextNodeView:  the y position should
be the ascent + leading in order to agree with the placement using
line height - descent (used with GlyphVector drawing).  So, add in the
LineMetrics.getLeading() to the y position.

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinTextNodeView.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinTextNodeView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinTextNodeView.java?rev=1818207&r1=1818206&r2=1818207&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinTextNodeView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinTextNodeView.java Thu Dec 14 20:19:58 2017
@@ -295,7 +295,7 @@ class TextPaneSkinTextNodeView extends T
             FontRenderContext fontRenderContext = Platform.getFontRenderContext();
             Font effectiveFont = getEffectiveFont();
             LineMetrics lm = effectiveFont.getLineMetrics("", fontRenderContext);
-            float ascent = lm.getAscent();
+            float ascent = lm.getAscent() + lm.getLeading();
 
             graphics.setFont(effectiveFont);