aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/properties
diff options
context:
space:
mode:
authorLuis Bernardo <lbernardo@apache.org>2014-05-11 22:06:49 +0000
committerLuis Bernardo <lbernardo@apache.org>2014-05-11 22:06:49 +0000
commitc4e5885007f3c61837a12ab330658b131d978247 (patch)
tree06a4431c3ea7457c9dcb1fb091c3a6e4287bf15c /src/java/org/apache/fop/fo/properties
parent71f5fd36ca5ef91741cb5a56cb156c227312acfe (diff)
downloadxmlgraphics-fop-c4e5885007f3c61837a12ab330658b131d978247.tar.gz
xmlgraphics-fop-c4e5885007f3c61837a12ab330658b131d978247.zip
FOP-2372: New extension to resize background images
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1593863 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/properties')
-rw-r--r--src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
index 78c8d9045..755d84547 100644
--- a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
+++ b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
@@ -84,6 +84,8 @@ public class CommonBorderPaddingBackground {
*/
public final Length backgroundPositionVertical;
+ public final Length backgroungImageTargetWidth;
+ public final Length backgroungImageTargetHeight;
private ImageInfo backgroundImageInfo;
@@ -353,6 +355,9 @@ public class CommonBorderPaddingBackground {
Constants.PR_BACKGROUND_POSITION_VERTICAL).getLength();
}
+ backgroungImageTargetWidth = pList.get(Constants.PR_X_BACKGROUND_IMAGE_WIDTH).getLength();
+ backgroungImageTargetHeight = pList.get(Constants.PR_X_BACKGROUND_IMAGE_HEIGHT).getLength();
+
initBorderInfo(pList, BEFORE,
Constants.PR_BORDER_BEFORE_COLOR,
Constants.PR_BORDER_BEFORE_STYLE,
@@ -397,18 +402,18 @@ public class CommonBorderPaddingBackground {
CommonBorderPaddingBackground cachedInstance = null;
/* if padding-* and background-position-* resolve to absolute lengths
* the whole instance can be cached */
- if ((newInstance.padding[BEFORE] == null
- || newInstance.padding[BEFORE].getLength().isAbsolute())
- && (newInstance.padding[AFTER] == null
- || newInstance.padding[AFTER].getLength().isAbsolute())
- && (newInstance.padding[START] == null
- || newInstance.padding[START].getLength().isAbsolute())
- && (newInstance.padding[END] == null
- || newInstance.padding[END].getLength().isAbsolute())
- && (newInstance.backgroundPositionHorizontal == null
- || newInstance.backgroundPositionHorizontal.isAbsolute())
- && (newInstance.backgroundPositionVertical == null
- || newInstance.backgroundPositionVertical.isAbsolute())) {
+ if ((newInstance.padding[BEFORE] == null || newInstance.padding[BEFORE].getLength().isAbsolute())
+ && (newInstance.padding[AFTER] == null || newInstance.padding[AFTER].getLength().isAbsolute())
+ && (newInstance.padding[START] == null || newInstance.padding[START].getLength().isAbsolute())
+ && (newInstance.padding[END] == null || newInstance.padding[END].getLength().isAbsolute())
+ && (newInstance.backgroundPositionHorizontal == null || newInstance.backgroundPositionHorizontal
+ .isAbsolute())
+ && (newInstance.backgroundPositionVertical == null || newInstance.backgroundPositionVertical
+ .isAbsolute())
+ && (newInstance.backgroungImageTargetHeight == null || newInstance.backgroungImageTargetHeight
+ .isAbsolute())
+ && (newInstance.backgroungImageTargetWidth == null || newInstance.backgroungImageTargetWidth
+ .isAbsolute())) {
cachedInstance = CACHE.fetch(newInstance);
}
synchronized (newInstance.backgroundImage.intern()) {
@@ -837,6 +842,8 @@ public class CommonBorderPaddingBackground {
backgroundImage,
backgroundPositionHorizontal,
backgroundPositionVertical,
+ backgroungImageTargetWidth,
+ backgroungImageTargetHeight,
borderInfo[BEFORE],
borderInfo[AFTER],
borderInfo[START],