Skip to content

Commit 3863890

Browse files
committed
Fixed an index error in FontTexture (issue #1308)
1 parent bbec096 commit 3863890

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

core/src/processing/opengl/FontTexture.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ public boolean addTexture() {
159159
currentTex = textures.length - 1;
160160

161161
PImage[] tempImg = images;
162-
images = new PImage[textures.length + 1];
162+
images = new PImage[textures.length];
163163
PApplet.arrayCopy(tempImg, images, tempImg.length);
164164
images[tempImg.length] = pg.wrapTexture(tex);
165165
}
166166
lastTex = currentTex;
167167

168168
// Make sure that the current texture is bound.
169-
//tex.bind();
169+
tex.bind();
170170

171171
return resize;
172172
}
@@ -324,14 +324,6 @@ protected void addToTexture(int idx, PFont.Glyph glyph) {
324324
}
325325
}
326326

327-
if (lastTex == -1) {
328-
lastTex = 0;
329-
}
330-
331-
if (currentTex != lastTex || resized) {
332-
currentTex = idx;
333-
}
334-
335327
TextureInfo tinfo = new TextureInfo(currentTex, offsetX, offsetY,
336328
w, h, rgba);
337329
offsetX += w;

0 commit comments

Comments
 (0)