MCPcopy Index your code
hub / github.com/processing/processing / getAscent

Method getAscent

app/src/processing/app/ui/Toolkit.java:1149–1154  ·  view source on GitHub ↗

Synthesized replacement for FontMetrics.getAscent(), which is dreadfully inaccurate and inconsistent across platforms.

(Graphics g)

Source from the content-addressed store, hash-verified

1147 * inaccurate and inconsistent across platforms.
1148 */
1149 static public double getAscent(Graphics g) {
1150 Graphics2D g2 = (Graphics2D) g;
1151 FontRenderContext frc = g2.getFontRenderContext();
1152 //return new TextLayout("H", font, frc).getBounds().getHeight();
1153 return new TextLayout("H", g.getFont(), frc).getBounds().getHeight();
1154 }
1155
1156
1157 static public int getMenuItemIndex(JMenu menu, JMenuItem item) {

Callers 11

paintComponentMethod · 0.95
paintComponentMethod · 0.95
paintComponentMethod · 0.95
paintComponentMethod · 0.95
getFontAscentMethod · 0.80
PFontMethod · 0.80
textAscentMethod · 0.80
paintComponentMethod · 0.80
drawMethod · 0.80
updateModeMethod · 0.80
paintMethod · 0.80

Calls 3

getFontRenderContextMethod · 0.80
getHeightMethod · 0.45
getFontMethod · 0.45

Tested by

no test coverage detected