Hello,

On Thu, Dec 29, 2011 at 6:37 AM, Youness Alaoui
<kakar...@kakaroto.homelinux.net> wrote:
> I'm trying to develop a small GUI using edje, and I've run into a few
> problems already... it seems that the 'clip_to' keyword screws up some
> stuff.
> Unless I'm understanding this wrong, the clip_to only means "do not draw
> anything that's outside of this area".. but if you do a clip_to on a TEXT
> or IMAGE and the clipping is a rect, it seems to actually override the
> other part, and apply it as a mask.. I'm not sure I can explain this
> properly so here's a test :
> http://dl.dropbox.com/u/22642664/edje_clip_to_bug.edc
> http://dl.dropbox.com/u/22642664/gnome-run.png (needed file)
>
> and here's a screenshot of the result (this is of course with latest SVN) :
> without clip_to :
> http://dl.dropbox.com/u/22642664/edje_clip_to_bug1.png
> as expected, we have a red background with the image on top
>
> with clip_to :
> http://dl.dropbox.com/u/22642664/edje_clip_to_bug2.png
> The background is now black and the image seems to have been xor-ed with
> the red...

It's not a bug, but the current expected behaviour. The object used
for the clip will vanish. At the moment we only support clip from a
rectangle, but we have code to handle clip from a image object. I find
it more obvious when you think about it with an image object rather
than a rectangle object. So that's why we do this multiplication with
the rectangle color.

> Another bug is apparently with the 'aspect' attribute of an IMAGE type
> part. If you set the aspect attribute, then the part will forget about its
> real size. More precisely, if I have an image in a group, and I create in
> another group a part of type GROUP and embed that group in it, then the
> image will overflow from its part.
> Hard to explain, so here's a sample code :
> http://dl.dropbox.com/u/22642664/edje_aspect_bug.edc
>
> Here's the result of the test without aspect: 1.0 1.0;
> http://dl.dropbox.com/u/22642664/edje_aspect_bug1.png
> And here it is again when you enable the aspect keyword :
> http://dl.dropbox.com/u/22642664/edje_aspect_bug2.png
>
> All I want basically is to have the image inside its group but with the
> proper aspect ratio. Note that adding 'to: "bg";' in the relative positions
> doesn't seem to change anything, once aspect keyword is there, it just
> seems to take its size/position relative to the full window. I haven't
> tried without this GROUP part, but it might be reproducable just by doing a
> relative "to" keyword.

Yes, this is a weird thing with aspect on image, their is currently no
way to tell it to get the aspect ratio of the original image. The
current solution is to define by yourself the aspect to match the
ratio of the original image. I was considering adding a new aspect
mode that would honor the original image ratio. I kind of think it's
worth it as many people are bitten by this limitation.

> p.s: Anyone knows how to use lua to get a part's object? all I saw in the
> doc is edje.edje() to create a new edje object.. but what if I want to
> write a script to get an existing part (like a text part) and modify it in
> lua? or in embryo how to change a TEXT part's text...

In embryo, you could just set_text(PART:my_part, "some_text") I think.
There is some example of that in detourious theme.

Have fun,
-- 
Cedric BAIL

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to