From 9cf58f1f404b069ab3f13f80daa774b7da4ff8e2 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Wed, 22 Jun 2005 06:46:09 +0000 Subject: Fixed Issue 165: GLUT 3.8 fixes bugs in glutStrokeLength and adds glutStrokeLengthf Added glutStrokeWidthf and glutStrokeLengthf and implemented glutStrokeWidth and glutStrokeLength in terms of them. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@305 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/net/java/games/jogl/util/GLUT.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/net/java/games/jogl') diff --git a/src/net/java/games/jogl/util/GLUT.java b/src/net/java/games/jogl/util/GLUT.java index 266f645f8..9f9ed1558 100644 --- a/src/net/java/games/jogl/util/GLUT.java +++ b/src/net/java/games/jogl/util/GLUT.java @@ -383,13 +383,17 @@ public class GLUT { } public int glutStrokeWidth (int font, char character) { + return (int) glutStrokeWidthf(font, character); + } + + public float glutStrokeWidthf (int font, char character) { StrokeFontRec fontinfo = getStrokeFont(font); int c = character & 0xFFFF; if (c < 0 || c >= fontinfo.num_chars) return 0; StrokeCharRec ch = fontinfo.ch[c]; if (ch != null) - return (int) ch.right; + return ch.right; else return 0; } @@ -410,8 +414,12 @@ public class GLUT { } public int glutStrokeLength (int font, String string) { + return (int) glutStrokeLengthf(font, string); + } + + public float glutStrokeLengthf (int font, String string) { StrokeFontRec fontinfo = getStrokeFont(font); - int length = 0; + float length = 0; int len = string.length(); for (int i = 0; i < len; i++) { char c = string.charAt(i); -- cgit v1.2.3