mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
re-apply the current font when using retina (fixes #2617)
This commit is contained in:
@@ -93,10 +93,13 @@ public class PGraphicsJava2D extends PGraphics {
|
||||
public boolean fillGradient;
|
||||
public Paint fillGradientObject;
|
||||
|
||||
protected Stroke strokeObject;
|
||||
protected Color strokeColorObject;
|
||||
public boolean strokeGradient;
|
||||
public Paint strokeGradientObject;
|
||||
|
||||
Font fontObject;
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
@@ -317,7 +320,14 @@ public class PGraphicsJava2D extends PGraphics {
|
||||
// Calling getGraphics() seems to nuke several settings.
|
||||
// It seems to be re-creating a new Graphics2D object each time.
|
||||
// https://github.com/processing/processing/issues/3331
|
||||
strokeImpl();
|
||||
if (strokeObject != null) {
|
||||
g2.setStroke(strokeObject);
|
||||
}
|
||||
// https://github.com/processing/processing/issues/2617
|
||||
if (fontObject != null) {
|
||||
g2.setFont(fontObject);
|
||||
}
|
||||
|
||||
handleSmooth();
|
||||
|
||||
/*
|
||||
@@ -1898,6 +1908,7 @@ public class PGraphicsJava2D extends PGraphics {
|
||||
font = font.deriveFont(map);
|
||||
g2.setFont(font);
|
||||
textFont.setNative(font);
|
||||
fontObject = font;
|
||||
|
||||
// Font dfont = font.deriveFont(size);
|
||||
//// Map<TextAttribute, ?> attrs = dfont.getAttributes();
|
||||
@@ -2371,7 +2382,8 @@ public class PGraphicsJava2D extends PGraphics {
|
||||
join = BasicStroke.JOIN_ROUND;
|
||||
}
|
||||
|
||||
g2.setStroke(new BasicStroke(strokeWeight, cap, join));
|
||||
strokeObject = new BasicStroke(strokeWeight, cap, join);
|
||||
g2.setStroke(strokeObject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -3,6 +3,8 @@
|
||||
text/fonts
|
||||
X Text looks blurry in GL Retina
|
||||
X https://github.com/processing/processing/issues/2739
|
||||
X text not getting the correct font in Retina2D
|
||||
X https://github.com/processing/processing/issues/2617
|
||||
|
||||
andres
|
||||
X ortho function is broken
|
||||
@@ -197,8 +199,6 @@ _ https://github.com/processing/processing/issues/2510
|
||||
_ check retina with PGraphicsRetina2D
|
||||
_ Text is half size in PGraphicsRetina2D
|
||||
_ https://github.com/processing/processing/issues/2738
|
||||
_ text not getting the correct font in Retina2D
|
||||
_ https://github.com/processing/processing/issues/2617
|
||||
|
||||
|
||||
decisions/misc
|
||||
|
||||
Reference in New Issue
Block a user