diff options
author | Kenneth Russel <[email protected]> | 2005-06-22 06:46:09 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-06-22 06:46:09 +0000 |
commit | 9cf58f1f404b069ab3f13f80daa774b7da4ff8e2 (patch) | |
tree | 8cdf1485974da4de148197581f6618fe4349b9cf /src/net/java/games/jogl/util | |
parent | e74e7f0b437fba3658f44ff775f4b63267c8538f (diff) |
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
Diffstat (limited to 'src/net/java/games/jogl/util')
-rw-r--r-- | src/net/java/games/jogl/util/GLUT.java | 12 |
1 files changed, 10 insertions, 2 deletions
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); |