Page 1 of 1

Problem with Image's clipping

Posted: Wed Oct 27, 2010 06:32
by houhou_x
Hey, if an image defined XOffset or YOffset, its rendering-area will be fixed by d_scaledOffset.

Code: Select all

   
void Image::draw(GeometryBuffer& buffer, const Rect& dest_rect,
    const Rect* clip_rect, const ColourRect& colours,
    QuadSplitMode quad_split_mode) const
{
    Rect dest(dest_rect);

    // apply rendering offset to the destination Rect
    dest.offset(d_scaledOffset);

    // draw
    d_owner->draw(buffer, d_area, dest, clip_rect, colours, quad_split_mode);
}

but its clipping-area has not been fixed. So this kind of images will display wrong. :(

I am not sure this is a bug, check it please, thanks :)

Re: Problem with Image's clipping

Posted: Wed Oct 27, 2010 08:54
by CrazyEddie
No version - or other - information has been provided here, your report is worthless. Please stop wasting our time with such pointless posts. Read the posts that tell you what information is required and, perhaps, try again. If you can't post the required information, do not post at all.

Thanks,

CE.

Re: Problem with Image's clipping

Posted: Wed Oct 27, 2010 17:31
by Jamarr
If you do not post the version of CEGUI you are using, preferably by copy/pasting the required section of your CEGUI.log file, we cannot even begin to diagnose your issue. It may be that this issue has already been fixed in a newer version or you may be using an unsupported version; and there is no guarantee that one answer works for all versions. So to avoid wasting everyone's time you must provide all relevant information before anyone can help you :hammer:

Re: Problem with Image's clipping

Posted: Wed Nov 17, 2010 09:29
by houhou_x
I really sorry about my carelessness :oops:

I compiled CEGUI 0.7.4 manually and run Sample_TreeDemo, I found the open-branch-icon and close-branch-icon disappeared.

Image

I checked "TaharezLook.imageset" and found these two images are defined:

Code: Select all

   <Image Name="TreeListClosed" XPos="175" YPos="111" Width="7" Height="11" XOffset="8" YOffset="2" />
   <Image Name="TreeListOpened" XPos="164" YPos="111" Width="11" Height="7" XOffset="8" YOffset="2"/>

They have properties of "XOffset" and "YOffset".

Then I checked CEGUI code,

Code: Select all

   
    void Image::draw(GeometryBuffer& buffer, const Rect& dest_rect,
        const Rect* clip_rect, const ColourRect& colours,
        QuadSplitMode quad_split_mode) const
    {
        Rect dest(dest_rect);

        // apply rendering offset to the destination Rect
        dest.offset(d_scaledOffset);

        // draw
        d_owner->draw(buffer, d_area, dest, clip_rect, colours, quad_split_mode);
    }

The rendering-area is fixed by d_scaledOffset, but clip-area is not.
I don't know whether this is a bug.

thanks again~

Re: Problem with Image's clipping

Posted: Thu Nov 18, 2010 20:48
by Mikademus
Have you checked if something devious is happening in the tree class? The reason I'm asking this is because it a 3:rd party hatchet job giving everyone headaches and suicidal impulses and is not actually considered part of the stable CEGUI package but rather something that can't be done away with until there is a replacement for it. The Tree class has been known to take unique liberties before...

Then again it might be an actual bug, I'm just warning before CE goes berserk over the Tree widget ;) I too have struggled with it and learned to loath it.

Re: Problem with Image's clipping

Posted: Sun Nov 21, 2010 09:43
by CrazyEddie
:lol: Good reply!!

I've seen this also, and I blame the tree widget completely ;) Images are used with offsets elsewhere without issue, so there's probably something incorrect in either the looknfeel or the WindowRenderer for the Tree, though to be completely honest, I have no intention of looking at it :P

CE.