From 49332d85d5af03ebb7fb0fe23341f0df929f9d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Thu, 9 Dec 2021 18:53:32 +0100 Subject: [PATCH] fix groovy x/y scale barcode rendering --- .../pdfbox/groovy/render/ParagraphRenderer.groovy | 3 ++- .../graphics/pdfbox/groovy/test/PdfBoxBarcodeTest.groovy | 8 ++++---- .../java/org/xbib/graphics/io/vector/svg/TestUtils.java | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/graphics-pdfbox-groovy/src/main/groovy/org/xbib/graphics/pdfbox/groovy/render/ParagraphRenderer.groovy b/graphics-pdfbox-groovy/src/main/groovy/org/xbib/graphics/pdfbox/groovy/render/ParagraphRenderer.groovy index 996bb97..ceb531b 100644 --- a/graphics-pdfbox-groovy/src/main/groovy/org/xbib/graphics/pdfbox/groovy/render/ParagraphRenderer.groovy +++ b/graphics-pdfbox-groovy/src/main/groovy/org/xbib/graphics/pdfbox/groovy/render/ParagraphRenderer.groovy @@ -231,7 +231,8 @@ class ParagraphRenderer implements Renderable { float width = barcode.width float height = barcode.height PdfBoxGraphics2D pdfBoxGraphics2D = new PdfBoxGraphics2D(pdfDocument.pdDocument, width, height) - BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(pdfBoxGraphics2D, null, 1.0d, + BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(pdfBoxGraphics2D, null, + 1.0d, 1.0d, java.awt.Color.WHITE, java.awt.Color.BLACK, false, false) renderer.render(symbol) renderer.close() diff --git a/graphics-pdfbox-groovy/src/test/groovy/org/xbib/graphics/pdfbox/groovy/test/PdfBoxBarcodeTest.groovy b/graphics-pdfbox-groovy/src/test/groovy/org/xbib/graphics/pdfbox/groovy/test/PdfBoxBarcodeTest.groovy index 12675b6..8fb7fcf 100644 --- a/graphics-pdfbox-groovy/src/test/groovy/org/xbib/graphics/pdfbox/groovy/test/PdfBoxBarcodeTest.groovy +++ b/graphics-pdfbox-groovy/src/test/groovy/org/xbib/graphics/pdfbox/groovy/test/PdfBoxBarcodeTest.groovy @@ -92,8 +92,8 @@ class PdfBoxBarcodeTest { BufferedImage bufferedImage = new BufferedImage(width as int, height as int, BufferedImage.TYPE_BYTE_GRAY) Graphics2D g2d = bufferedImage.createGraphics() Rectangle rectangle = new Rectangle(0, 0, width as int, height as int) - BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(g2d, rectangle, 1.0d, - Color.WHITE, Color.BLACK, false, false) + BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(g2d, rectangle, + 1.0d, 1.0d, Color.WHITE, Color.BLACK, false, false) renderer.render(code3Of9) renderer.close() PDImageXObject img = LosslessFactory.createFromImage(document, bufferedImage) @@ -120,8 +120,8 @@ class PdfBoxBarcodeTest { void create(float x, float y, float width, float height, Code3Of9 code3Of9) { PdfBoxGraphics2D pdfBoxGraphics2D = new PdfBoxGraphics2D(document, width, height) Rectangle rectangle = new Rectangle(0, 0, width as int, height as int) - BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(pdfBoxGraphics2D, rectangle, 1.0d, - Color.WHITE, Color.BLACK, false, false) + BarcodeGraphicsRenderer renderer = new BarcodeGraphicsRenderer(pdfBoxGraphics2D, rectangle, + 1.0d, 1.0d, Color.WHITE, Color.BLACK, false, false) renderer.render(code3Of9) renderer.close() PDFormXObject xFormObject = pdfBoxGraphics2D.getXFormObject() diff --git a/graphics-vector-svg/src/test/java/org/xbib/graphics/io/vector/svg/TestUtils.java b/graphics-vector-svg/src/test/java/org/xbib/graphics/io/vector/svg/TestUtils.java index 6d38517..dfd8305 100644 --- a/graphics-vector-svg/src/test/java/org/xbib/graphics/io/vector/svg/TestUtils.java +++ b/graphics-vector-svg/src/test/java/org/xbib/graphics/io/vector/svg/TestUtils.java @@ -67,7 +67,6 @@ public abstract class TestUtils { assertEquals(expectedFrags.size(), actualFrags.size()); } - @SuppressWarnings("serial") public static class Template extends LinkedList { public Template(Object[] lines) { Collections.addAll(this, lines);