Merge pull request #5633 from liquid600pgm/master

Fix for #5625 - Made tab widths consistent across renderers
This commit is contained in:
Ben Fry
2018-08-30 12:28:32 -04:00
committed by GitHub
+4
View File
@@ -4595,6 +4595,10 @@ public class PGraphics extends PImage implements PConstants {
* ignored.
*/
public void text(String str, float x, float y) {
// fix for #5625 pixelDensity(2) breaks the width of a tab ("\t") in JAVA2D
// makes the tab width consistent across renderers
str = str.replaceAll("\t", " ");
if (textFont == null) {
defaultFontOrDeath("text");
}