Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3997034
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:21:07+00:00 2026-05-20T07:21:07+00:00

I’m making a Gui where Widgets have children, and children are both clipped in

  • 0

I’m making a Gui where Widgets have children, and children are both clipped in the hit test, and in rendering, to the parent’s rectangle. However it is not always like this. A widget can choose not to clip its children. In this case, the children are bound to the parent’s parent rectangle. My rendering currently reflects this, but my hit test does not.

Here is my hit test:

AguiWidget* AguiEventManager::GetWidgetUnderMouse( AguiWidget* root,
                                            const AguiMouseEventArgs &mouse )
{
    /* sets the current node to the root node
    while a widget passes the hit test
    and the current node has children,
    iterate through the current node's 
    children and set the current node
    to the child who passes the hit test */

    AguiWidget* currentNode = root;

        bool foundsomething = true;
        while(foundsomething)
        {
            foundsomething = false;
            if(currentNode->getChildWidgetCount() > 0)
            for (std::vector<AguiWidget*>::const_reverse_iterator rit = 
                currentNode->getChildRBeginIterator();
                rit < currentNode->getChildREndIterator(); ++rit) 
            { 
                if (((*rit)->intersectionWithPoint(mouse.getPosition())
                    )
                    && (*rit)->isEnabled() && (*rit)->isVisible()) 
                { 
                     foundsomething = true;
                     currentNode = *rit;
                     break;
                } 

            } 

        }
        return currentNode;


}

How could I modify this to deal with (*rit)->isClippingChildren(); ?

Basically at the moment, what it does is, it finds the first widget that passes a hit test, it then digs through its children because only they can then be eligible. And it continues to do this until there are no more children to dig into, and therefore the last widget found is the correct one. This needs to change to something more like this:

If the widget is not clipping its children, then if its parent passed the hit test, we check the children of the one who is not clipping its children. If none of them pass the hit test, then we need to go back and carry on from where we were.

I have a feeling some type of queue could be useful but I’m just not sure how.

The essential result of the modification is that it would be the same outcome as if the same algorithm was used as above, except if a widget is not clipping its children, we just let its children be processed as children of the parent.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:21:08+00:00Added an answer on May 20, 2026 at 7:21 am

    Give your AguiWidget a hitTest, and let it recurse into its children when positive.
    Then when clicking on a clipped area, the gitTest of the parent (clipping) widget will fail, and the hit test will never be performed for the clipped Widget.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.