Author: acumiskey
Date: Wed Oct 15 06:27:06 2008
New Revision: 704907

URL: http://svn.apache.org/viewvc?rev=704907&view=rev
Log:
More readable.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java?rev=704907&r1=704906&r2=704907&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java 
Wed Oct 15 06:27:06 2008
@@ -393,12 +393,15 @@
                         int width = area.getIPD();
                         width += backProps.getPaddingStart(false, context);
                         width += backProps.getPaddingEnd(false, context);
-                        
back.setHoriz(backProps.backgroundPositionHorizontal.getValue(
-                                new SimplePercentBaseContext(context,
-                                    
LengthBase.IMAGE_BACKGROUND_POSITION_HORIZONTAL,
-                                    (width - 
back.getImageInfo().getSize().getWidthMpt())
-                                )
-                            ));
+                        int imageWidthMpt = 
back.getImageInfo().getSize().getWidthMpt();
+                        int lengthBaseValue = (width - imageWidthMpt);
+                        SimplePercentBaseContext simplePercentBaseContext
+                            = new SimplePercentBaseContext(context,
+                            LengthBase.IMAGE_BACKGROUND_POSITION_HORIZONTAL,
+                            lengthBaseValue);
+                        int horizontal = 
backProps.backgroundPositionHorizontal.getValue(
+                                simplePercentBaseContext);
+                        back.setHoriz(horizontal);
                     } else {
                         //TODO Area IPD has to be set for this to work
                         log.warn("Horizontal background image positioning 
ignored"
@@ -414,12 +417,15 @@
                         int height = area.getBPD();
                         height += backProps.getPaddingBefore(false, context);
                         height += backProps.getPaddingAfter(false, context);
-                        
back.setVertical(backProps.backgroundPositionVertical.getValue(
-                                new SimplePercentBaseContext(context,
-                                     
LengthBase.IMAGE_BACKGROUND_POSITION_VERTICAL,
-                                     (height - 
back.getImageInfo().getSize().getHeightMpt())
-                                )
-                            ));
+                        int imageHeightMpt = 
back.getImageInfo().getSize().getHeightMpt();
+                        int lengthBaseValue = (height - imageHeightMpt);
+                        SimplePercentBaseContext simplePercentBaseContext
+                            = new SimplePercentBaseContext(context,
+                                LengthBase.IMAGE_BACKGROUND_POSITION_VERTICAL,
+                                lengthBaseValue);
+                        int vertical = 
backProps.backgroundPositionVertical.getValue(
+                                simplePercentBaseContext);
+                        back.setVertical(vertical);
                     } else {
                         //TODO Area BPD has to be set for this to work
                         log.warn("Vertical background image positioning 
ignored"



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

Reply via email to