http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2153

*** shadow/2153 Wed Jun 13 07:36:40 2001
--- shadow/2153.tmp.14706       Wed Jun 13 07:36:40 2001
***************
*** 0 ****
--- 1,83 ----
+ +============================================================================+
+ | Borders are calculated incorrectly                                         |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2153                        Product: Fop                     |
+ |       Status: NEW                         Version: all                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Critical                 OS/Version: Linux                   |
+ |     Priority: Other                     Component: pdf renderer            |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: [EMAIL PROTECTED]                                       |
+ |  Reported By: [EMAIL PROTECTED]                                             |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ this patch calculate table cell content offset and table cell height
+ when fo:table border-collapse property is "separate"
+ 
+ cell border sizes got from properties specified directly on cell
+ (they should be combined with other cell borders or table borders)
+ 
+ The patch was made by Ivan Demakov <[EMAIL PROTECTED]> for one of our projects.
+ 
+ --- src/org/apache/fop/fo/flow/TableCell.java.orig    Wed Jun  6 15:04:12 2001
+ +++ src/org/apache/fop/fo/flow/TableCell.java Wed Jun  6 16:12:32 2001
+ @@ -47,6 +47,9 @@
+                */
+               protected int beforeOffset;
+  
+ +             /* ivan demakov */
+ +             protected int borderHeight = 0;
+ +
+               protected int height = 0;
+               protected int top; // Ypos of cell ???
+               protected int verticalAlign ;
+ @@ -155,7 +158,7 @@
+                               this.cellArea =
+                                               new 
+AreaContainer(propMgr.getFontState(area.getFontInfo()),
+                                                                                      
+                                 startOffset, beforeOffset,
+ -                                                                                    
+                                 width, area.spaceLeft()- m_borderSeparation/2,
+ +                                                                                    
+                                 width, area.spaceLeft()- m_borderSeparation/2 + 
+borderHeight/2,
+                                                                                      
+                                 Position.RELATIVE);
+  
+                               cellArea.foCreator=this;        // G Seshadri
+ @@ -215,7 +218,7 @@
+               // TableRow calls this. Anyone else?
+               public int getHeight() {
+                               // return cellArea.getHeight() + spaceBefore + 
+spaceAfter;
+ -                             return cellArea.getHeight() + m_borderSeparation ;
+ +                             return cellArea.getHeight() + m_borderSeparation - 
+borderHeight / 2;
+               }
+  
+               /** Called by TableRow to set final size of cell content rectangles and
+ @@ -230,7 +233,7 @@
+                               //      cellArea.setMaxHeight(h);
+                               // Increase content height by difference of row 
+content height
+                               // and current cell allocation height (includes 
+borders & padding)
+ -                             cellArea.increaseHeight(h - cellArea.getHeight());
+ +                             cellArea.increaseHeight(h + borderHeight/2 - 
+cellArea.getHeight());
+                               if (bRelativeAlign) {
+                                               // Must get info for all cells 
+starting in row!
+                                               // verticalAlign can be BEFORE or 
+BASELINE
+ @@ -316,6 +319,19 @@
+                                                       column. Look out for spanning 
+columns.
+                                               */
+  
+ +                                             /* ivan demakov */
+ +                                             int borderStart  = 
+bp.getBorderLeftWidth(false);
+ +                                             int borderEnd    = 
+bp.getBorderRightWidth(false);
+ +                                             int borderBefore = 
+bp.getBorderTopWidth(false);
+ +                                             int borderAfter  = 
+bp.getBorderBottomWidth(false);
+ +
+ +                                             int contentOffset = borderStart/2 + 
+bp.getPaddingLeft(false);
+ +
+ +                                             this.startOffset += contentOffset;
+ +                                             this.width -= (contentOffset + 
+borderEnd/2 + bp.getPaddingRight(false));
+ +
+ +                                             this.beforeOffset = borderBefore/2 + 
+bp.getPaddingTop(false);
+ +                                             this.borderHeight = borderBefore + 
+borderAfter;
+                               }
+               }
+  }
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to