MCPcopy Create free account
hub / github.com/benfry/processing4 / textAscent

Method textAscent

core/src/processing/awt/PGraphicsJava2D.java:1870–1887  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1868
1869
1870 @Override
1871 public float textAscent() {
1872 if (textFont == null) {
1873 defaultFontOrDeath("textAscent");
1874 }
1875
1876 // This value is dreadfully inaccurate and inconsistent, and especially
1877 // so for the default font. Switching to use our built-in calculation since
1878 // our most common use case is likely textAlign(CENTER, CENTER) with the
1879 // default font, and it needs to work well there. [fry 230716]
1880 /*
1881 Font font = (Font) textFont.getNative();
1882 if (font != null) {
1883 return g2.getFontMetrics(font).getAscent();
1884 }
1885 */
1886 return super.textAscent();
1887 }
1888
1889
1890 @Override

Callers

nothing calls this directly

Calls 1

defaultFontOrDeathMethod · 0.80

Tested by

no test coverage detected