[
https://issues.apache.org/jira/browse/PIVOT-166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Todd Volkert updated PIVOT-166:
-------------------------------
Description:
Run the WatermarkDecoratorTest to see this behavior. WatermarkDecorator
reports the component's bounds in getBounds(), it uses an identity transform,
and it doesn't alter the clip rect of the graphics, yet the watermark is being
painted outside the bounds of the decorated component (in the case of the test,
the decorated component is the CardPane that lives in the TablePane's row
beklow the line).
was:
Run the WatermarkDecoratorTest to see this behavior. WatermarkDecorator
reports the component's bounds in getBounds(), it uses an identity transform,
and it doesn't alter the clip rect of the graphics, yet the watermark is being
painted outside the bounds of the decorated component (in the case of the test,
the decorated component is the CardPane that lives in the TablePane's row
beklow the line).
It's possible that the Graphics.rotate() that WatermarkDecorator applies in
update() is the cause of this, and maybe it should return a rotate transform in
getTransform() - this is where I'll start the investigation.
Summary: Decorators are given incorrect clip rect (was:
WatermarkDecorator overruns its bounds)
I've tracked this down to Container.paint(), and the problem is not with or
unique to WatermarkDecorator. The issue is that we only clip to the child
component's bounds on componentGraphics, which is a copy of decoratedGraphics.
Thus, decoratedGraphics never gets the clip, and it's left with the clip of its
parent.
It's possible that this is meant as a feature - I know that decorators are
allowed to paint outside their bounds but not their parent's bounds. However,
I thought that this meant that decorators were supposed to restrict their
decorated bounds to the bounds of their parent (as a matter of policy), and
that they would be given a clip equal to their decorated bounds. It's pretty
confusing to report your decorated bounds as that of your component and to be
given a larger clip. In the case of the watermark decorator, it has to call
graphics primitives methods on regions outside of its decorated bounds, and it
relies on that clip.
The bottom line is: should WatermarkDecorator and those like it be changed to
clip to their bounds before they draw, or should this be addressed on Container?
> Decorators are given incorrect clip rect
> ----------------------------------------
>
> Key: PIVOT-166
> URL: https://issues.apache.org/jira/browse/PIVOT-166
> Project: Pivot
> Issue Type: Bug
> Components: wtk-effects
> Reporter: Todd Volkert
> Assignee: Todd Volkert
> Fix For: 1.3
>
>
> Run the WatermarkDecoratorTest to see this behavior. WatermarkDecorator
> reports the component's bounds in getBounds(), it uses an identity transform,
> and it doesn't alter the clip rect of the graphics, yet the watermark is
> being painted outside the bounds of the decorated component (in the case of
> the test, the decorated component is the CardPane that lives in the
> TablePane's row beklow the line).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.