From 3bbbce9ae31ab73aba63416f51d6eb8ad925508e Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sat, 3 Nov 2007 01:23:27 +0000 Subject: Added flush() call to render loop needed for new TextRenderer. Added implementation of new RenderDelegate.getBounds(GlyphVector, FontRenderContext). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@226 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4 --- src/demos/j2d/CustomText.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/demos/j2d/CustomText.java b/src/demos/j2d/CustomText.java index 05c0048..aba7b97 100755 --- a/src/demos/j2d/CustomText.java +++ b/src/demos/j2d/CustomText.java @@ -309,6 +309,7 @@ public class CustomText extends Demo { 0); gl.glRotatef(info.angle, 0, 0, 1); renderer.draw(info.text, 0, 0); + renderer.flush(); } renderer.endRendering(); @@ -393,7 +394,10 @@ public class CustomText extends Demo { public Rectangle2D getBounds(String str, Font font, FontRenderContext frc) { - GlyphVector gv = font.createGlyphVector(frc, str); + return getBounds(font.createGlyphVector(frc, str), frc); + } + + public Rectangle2D getBounds(GlyphVector gv, FontRenderContext frc) { Rectangle2D stringBounds = gv.getPixelBounds(frc, 0, 0); return new Rectangle2D.Double(stringBounds.getX(), stringBounds.getY(), -- cgit v1.2.3