Skip to content

Commit 84b937a

Browse files
committed
Fix weird letter misalignments
1 parent 579a56c commit 84b937a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

preview/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
p.textSize(80);
3838
p.textAlign(p.LEFT, p.TOP)
3939
p.textFont(f)
40-
p.text('hello,\nworld!', 10, 30, p.width);
40+
p.text('hello, world!', 10, 30, p.width);
4141
};
4242
};
4343

src/webgl/shaders/font.vert

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void main() {
2424
1. / length(newOrigin - newDX),
2525
1. / length(newOrigin - newDY)
2626
);
27-
vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);
27+
vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5));
2828
vec2 textureOffset = offset * (1. / vec2(
2929
uGlyphRect.z - uGlyphRect.x,
3030
uGlyphRect.w - uGlyphRect.y

src/webgl/text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ function text(p5, fn){
207207
}
208208
case 'Q': {
209209
const [, x1, y1, x, y] = command;
210-
return { type, x, y, x1, y1 };
210+
return { type, x1, y1, x, y };
211211
}
212212
case 'C': {
213213
const [, x1, y1, x2, y2, x, y] = command;
214-
return { type, x, y, x1, y1, x2, y2 };
214+
return { type, x1, y1, x2, y2, x, y };
215215
}
216216
default: {
217217
throw new Error(`Unexpected path command: ${type}`);

0 commit comments

Comments
 (0)