svn commit: r1751695 - in /xmlgraphics/fop/trunk/fop-core/src: main/java/org/apache/fop/render/afp/AFPImageHandler.java test/java/org/apache/fop/render/afp/AFPImageHandlerTestCase.java

[email protected]
Newsgroups gmane.text.xml.fop.cvs
Message-ID <[email protected]>
Author: ssteiner
Date: Wed Jul  6 14:51:02 2016
New Revision: 1751695

URL: http://svn.apache.org/viewvc?rev=1751695&view=rev
Log:
FOP-2620: AFP round table border not aligned

Added:
    xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerTestCase.java   (with props)
Modified:
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandler.java

Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandler.java?rev=1751695&r1=1751694&r2=1751695&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandler.java (original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandler.java Wed Jul  6 14:51:02 2016
@@ -110,9 +110,8 @@ public abstract class AFPImageHandler im
 
         int[] coords = unitConv.mpts2units(new float[] {targetRect.x, targetRect.y});
 
-        int width = Math.round(unitConv.mpt2units(targetRect.width));
-
-        int height = Math.round(unitConv.mpt2units(targetRect.height));
+        int width = (int) Math.ceil(unitConv.mpt2units(targetRect.width));
+        int height = (int) Math.ceil(unitConv.mpt2units(targetRect.height));
 
         int resolution = paintingState.getResolution();
         AFPObjectAreaInfo objectAreaInfo = new AFPObjectAreaInfo(coords[X], coords[Y], width,

Added: xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerTestCase.java?rev=1751695&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerTestCase.java (added)
+++ xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerTestCase.java Wed Jul  6 14:51:02 2016
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.afp;
+
+import java.awt.Rectangle;
+
+import org.junit.Test;
+
+import org.apache.fop.afp.AFPObjectAreaInfo;
+import org.apache.fop.afp.AFPPaintingState;
+
+import junit.framework.Assert;
+
+public class AFPImageHandlerTestCase {
+
+    @Test
+    public void testAFPImageHandlerSize() {
+        AFPObjectAreaInfo areaInfo = AFPImageHandler.createObjectAreaInfo(new AFPPaintingState(),
+                new Rectangle(0, 0, 1000, 1000));
+        Assert.assertEquals(areaInfo.getHeight(), 4);
+    }
+}

Propchange: xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.