You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Robert Meyer <rm...@hotmail.co.uk> on 2012/12/19 16:40:57 UTC

Image align and overflow behaviour since complex scripts patch

Hi,

I have noticed that since the complex scripts change, if you right-align an image in a cell and it exceeds the bounds of the cell, it will start expanding in the opposite direction as opposed to staying locked to the right side. Is this behaviour correct? I have attached two PDF's showing this with one run on trunk and one using code from before the patch.

>From looking in the code there is now a check on line 352 in LineLayoutManager.java which checks the difference for a negative value before its assigned to the startIndent. If it is found to be the case, its changed to 0 which prevents the content from overrunning the left side. Although its a bit cryptic, I found the following under the external-graphic section in the XSL:FO specification which leads me to believe it should stay locked to the direction assigned by the text-align property:

"Once scaled, the reference-area
is aligned with respect to the viewport-area
using the text-align and
display-align
traits. If it is too large for the viewport-area,
the graphic is aligned as if it would fit and the overflow
trait controls the clipping, scroll bars, etc."

I did also notice that negative start-indent values are allowed under blocks, but I am not sure if this is relevant.

This is primarily about clarifying which is correct as I would have presumed that if something is right aligned and it exceeds it's parents bounds, it will overflow in the direction it was assigned. 

Thanks,

Robert Meyer
 		 	   		  

Re: Image align and overflow behaviour since complex scripts patch

Posted by Glenn Adams <gl...@skynav.com>.
i would suggest you open an issue, marking this as a regression

On Wed, Dec 19, 2012 at 7:40 AM, Robert Meyer <rm...@hotmail.co.uk> wrote:

> Hi,
>
> I have noticed that since the complex scripts change, if you right-align
> an image in a cell and it exceeds the bounds of the cell, it will start
> expanding in the opposite direction as opposed to staying locked to the
> right side. Is this behaviour correct? I have attached two PDF's showing
> this with one run on trunk and one using code from before the patch.
>
> From looking in the code there is now a check on line 352 in
> LineLayoutManager.java which checks the difference for a negative value
> before its assigned to the startIndent. If it is found to be the case, its
> changed to 0 which prevents the content from overrunning the left side.
> Although its a bit cryptic, I found the following under the
> external-graphic section in the XSL:FO specification which leads me to
> believe it should stay locked to the direction assigned by the text-align
> property:
>
> "Once scaled, the reference-area is aligned with respect to the
> viewport-area using the *text-align* and *display-align* traits. If it is
> too large for the viewport-area, the graphic is aligned as if it would fit
> and the *overflow* trait controls the clipping, scroll bars, etc."
>
> I did also notice that negative start-indent values are allowed under
> blocks, but I am not sure if this is relevant.
>
> This is primarily about clarifying which is correct as I would have
> presumed that if something is right aligned and it exceeds it's parents
> bounds, it will overflow in the direction it was assigned.
>
> Thanks,
>
> Robert Meyer
>