Closed GoogleCodeExporter closed 9 years ago
You're either doing something wrong, or using an out of date version of PlayN.
I just tested placing a SurfaceLayer inside a clipped GroupLayer and it works
fine. Try your code against the latest trunk.
Original comment by m...@samskivert.com
on 28 Jul 2012 at 4:06
[deleted comment]
Is it intended to not work when you have a Hierarchy such as:
GroupLayer---------->GroupLayer
| SurfaceLayer SurfaceLayer
|
|
V
GroupLayer-------->GroupLayer
SurfaceLayer SurfaceLayer
Original comment by heg...@gmail.com
on 30 Jul 2012 at 6:26
I don't understand your diagram. What's a child of what? And which GroupLayer
is clipped?
Original comment by m...@samskivert.com
on 30 Jul 2012 at 6:27
My basic Widget is called a BPanel, all GUI elements descend from this and each
contain by default a GroupLayer.Clipped, and a SurfaceLayer for drawing. Let's
say I wanted to add a button onto my panel.
The hierarchy ends up like this
BPanel------------BButton
|_GroupLayer--------GroupLayer
|_SurfaceLayer SurfaceLayer
The BPanel's GroupLayer holds the following:
BPanel's SurfaceLayer
BButton's GroupLayer
The BButton's GroupLayer only holds the BButton's SurfaceLayer.
Original comment by heg...@gmail.com
on 30 Jul 2012 at 6:32
[deleted comment]
With that hierarchy, the BButton's surfacelayer ends up drawing outside the
BPanel's GroupLayer. I figured it would be stopped by its own GroupLayer being
clipped by the parent GroupLayer, but apparently not.
Original comment by heg...@gmail.com
on 30 Jul 2012 at 6:33
Clipping does not "nest". If you put a clipped group layer inside another
clipped group layer, the nested group layer's clip will replace the outer group
layer's clip, not intersect with it. Indeed, I doubt the outer group layer's
clip would even be restored when the inner group finished rendering.
Clipped group layers are expensive (clipping is expensive). You should only use
them when absolutely necessary. Baking them into the lowest level of your UI
toolkit is a bad idea.
The vast majority of widgets in your toolkit should render inside their bounds.
If they are all rendered to surface layers, then they will necessarily do so
because they can't render outside the bounds of the surface. The only place
where you need clipping is if you want a "scrolling panel" which allows many
sub-components to be rendered in a virtual space which is clipped to the bounds
of the scrolling panel. Only the scrolling panel would use a clipped group
layer, and naturally you would never nest scrolling panels. That would be a
user interface disaster in addition to simply not rendering properly.
Original comment by m...@samskivert.com
on 30 Jul 2012 at 6:40
Original issue reported on code.google.com by
heg...@gmail.com
on 27 Jul 2012 at 2:56