aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-04 07:33:21 +0100
committerSven Göthel <[email protected]>2024-02-04 07:33:21 +0100
commit6caed46dba2c8be34c3cb32dc6bddf31f98eac02 (patch)
treec9804afdb6d0f31acd5b116e5fc886e06b0a8c8f /src/jogl/classes/com
parent8fcbeaa4e440e1bb8e51658f15a35d2a217dc0bc (diff)
Use new com.jogamp.common.util.StringUtil (GlueGen)
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java11
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java15
2 files changed, 2 insertions, 24 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
index 5d60e2686..b538d1546 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
@@ -55,17 +55,6 @@ public class TextRegionUtil {
this.renderModes = renderModes;
}
- public static int getCharCount(final String s, final char c) {
- final int sz = s.length();
- int count = 0;
- for(int i=0; i<sz; i++) {
- if( s.charAt(i) == c ) {
- count++;
- }
- }
- return count;
- }
-
/**
* Add the string in 3D space w.r.t. the font in font em-size [0..1] at the end of the {@link GLRegion}
* while passing the progressed {@link AffineTransform}.
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java b/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java
index 622c5d29a..be8219634 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java
@@ -30,6 +30,7 @@ package com.jogamp.opengl.util.av;
import java.time.format.DateTimeParseException;
import com.jogamp.common.av.PTS;
+import com.jogamp.common.util.StringUtil;
/**
* Text Event Line including ASS/SAA of {@link SubtitleEvent}
@@ -215,19 +216,7 @@ public class SubTextEvent extends SubtitleEvent {
this.name = name;
this.effect = effect;
this.text = text.replace("\\N", "\n");
- {
- final int len = this.text.length();
- int lc = 1;
- for(int i=0; len > i; ) {
- final int j = this.text.indexOf("\n", i);
- if( 0 > j ) {
- break;
- }
- ++lc;
- i = j + 1;
- }
- this.lines = lc;
- }
+ this.lines = StringUtil.getLineCount(this.text);
}
@Override