Excerpts from donn's message of Wed Jul 21 04:28:58 +0100 2010:
> pyClutter 1.0
> Clutter 1.3.6
> 
> If I clone another Actor (which has 'pick-with-alpha' True), the clone 
> ignores it.
Hi Donn,

I'm assuming that we are talking about having a ClutterTexture source
actor with "pick-with-alpha" = TRUE and then you are cloning that actor
with a ClutterClone. If that's not right then we need a bit more
information to understand your setup.

One thing to understand is that the value of the "pick-with-alpha"
option for ClutterTexture is orthogonal to how picking is handled for a
ClutterClone. Ignoring cloning for a moment; if you have a normal
ClutterTexture then by default the pick function will behave as if the
texture is an opaque rectangle. If on the other hand you have texture
with an alpha component and you draw an opaque circle with transparency
outside the circle, then if you want picking to only pick for opaque
pixels inside the circle then you could set "pick-with-alpha" = TRUE.

If that doesn't work for you then it's a bug.

> 
> Is this intended, code-to-come, or some kind of bug?
For the above use case (not involving ClutterClone)  "pick-with-alpha"
should work, so there's no "code-to-come" in that sense.

> 
> Is there some trick I could employ to get the clone to pick properly?

The problem that I think you're seeing is that ClutterClone uses the
default ClutterActor pick function which is just a rectangle covering
the transformed allocation and we don't currently provide a mechanism to
pass through to the pick method of the source actor.

There are a number of use cases that ClutterClone doesn't currently
support but I think your case can be solved with an extra property
something like:

A "pick-with-source-shape" boolean property (default FALSE to match
current semantics)

If set to true then when picking a ClutterClone we would ask the source
actor to paint its picking shape but using the ID of the ClutterClone
actor. In your case when cloning a ClutterTexture with "pick-with-alpha"
set, then the clone could be picked according to the same shape as the
source.

One thing to note is that presumably if the source was a
composite/container actor then we would still traverse all its children
to paint their picking geometry, and I think you'd expect all of those
children to also pick with the overridden ID of the clone.

Some other use cases possibly worth considering related to this are:
1) being able to pick with the original source actor ID.
2) being able to use the pick-with-source-shape method with the clone's
   ID (as above) but possibly not draw picking geometry for children of
   composite/container actors.
These both bring up more awkward questions, such as how do we make sure
that actors recognize picks against the original vs the clone so should
probably be solved separately.

I hope that clarifies what's going wrong for you,
It could be good to file a feature request for the above ClutterClone
property so we can keep track of this and potentially - since it sounds
like it wouldn't be too tricky to implement - we might be able to get
this done for 1.4.

kind regards,
- Robert
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to