Synthesized replacement for FontMetrics.getAscent(), which is dreadfully inaccurate and inconsistent across platforms.
(Graphics g)
| 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) { |
no test coverage detected