additional tweak for tab width change

This commit is contained in:
Ben Fry
2018-08-30 12:30:24 -04:00
parent 699359760e
commit 434c78ed2e
2 changed files with 15 additions and 3 deletions
+5 -3
View File
@@ -4595,9 +4595,11 @@ 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 (str.indexOf('\t') != -1) {
// https://github.com/processing/processing/issues/5625
// https://github.com/processing/processing/pull/5633
str = str.replaceAll("\t", " ");
}
if (textFont == null) {
defaultFontOrDeath("text");
+10
View File
@@ -1,5 +1,13 @@
0266 (3.4.1 or 3.5)
X make JSONObject.quote() (both versions) public
X fix javaPlatform variable for newer JDK versions
X https://github.com/processing/processing/pull/5626
contrib
X make tabs into spaces, fixes pixelDensity(2) issue with tabs
X https://github.com/processing/processing/issues/5625
X https://github.com/processing/processing/pull/5633
_ NullPointerException at java.awt.Window.init(Window.java:497) when using Airplay
_ https://github.com/processing/processing/issues/5620
@@ -9,6 +17,8 @@ data
_ Dict.remove() should return value, not index (for consistency w/ others)
_ check again whether element 0,0 in a Table is working
_ https://github.com/processing/processing/issues/3011
_ should DoubleDict create from Iterable or Map<>?
_ (Map is more efficient b/c of size, Iterable more useful)
3.5+