diff --git a/core/todo.txt b/core/todo.txt index fb90d9ed2..b41451b2b 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -2,6 +2,8 @@ X make edits to core so that awt can be flagged off, and lwjgl can run X https://github.com/codeanticode/processing-openjdk/commit/ac9abc18655daaa538ef16945687177334f3596e X add --disable-awt to PApplet.main() +X fix for precision issues with PDF +X https://github.com/processing/processing/issues/5801#issuecomment-466632459 before final release @@ -21,8 +23,6 @@ _ move AWT code out of PImage, and into its own PImageJava2D class _ how to handle with JavaFX? _ https://github.com/processing/processing4/issues/56 -_ possible fix for precision issues with PDF -_ https://github.com/processing/processing/issues/5801#issuecomment-466632459 high-ish diff --git a/java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java b/java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java index 5987508c6..ce72d44a1 100644 --- a/java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java +++ b/java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java @@ -29,6 +29,7 @@ import java.util.*; import com.lowagie.text.*; import com.lowagie.text.pdf.*; +import com.lowagie.text.pdf.ByteBuffer; import processing.awt.PGraphicsJava2D; import processing.core.*; @@ -121,6 +122,9 @@ public class PGraphicsPDF extends PGraphicsJava2D { // long t0 = System.currentTimeMillis(); if (document == null) { + // https://github.com/processing/processing/issues/5801#issuecomment-466632459 + ByteBuffer.HIGH_PRECISION = true; + document = new Document(new Rectangle(width, height)); boolean missingPath = false; try {