deal with deprecation changes in PDF

This commit is contained in:
Ben Fry
2020-01-20 14:54:38 -05:00
parent 1cbdd36ec7
commit 624e9074ae
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/processing-core"/>
<classpathentry kind="lib" path="library/itext.jar" sourcepath="itext-src.zip"/>
<classpathentry combineaccessrules="false" kind="src" path="/processing4-core"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -177,7 +177,7 @@ public class PGraphicsPDF extends PGraphicsJava2D {
// long t = System.currentTimeMillis();
mapper = new DefaultFontMapper();
if (PApplet.platform == PConstants.MACOSX) {
if (PApplet.platform == PConstants.MACOS) {
try {
String homeLibraryFonts =
System.getProperty("user.home") + "/Library/Fonts";
@@ -428,7 +428,7 @@ public class PGraphicsPDF extends PGraphicsJava2D {
scale((x2 - x1) / imageWidth,
(y2 - y1) / imageHeight);
if (u2-u1 == imageWidth && v2-v1 == imageHeight) {
g2.drawImage(image.getImage(), 0, 0, null);
g2.drawImage((Image) image.getNative(), 0, 0, null);
} else {
PImage tmp = image.get(u1, v1, u2-u1, v2-v1);
g2.drawImage((Image) tmp.getNative(), 0, 0, null);