[fixed] GUI elements clipping problem

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Aelis440
Posts: 52
Joined: Sun Oct 05, 2008 8:45 pm

[fixed] GUI elements clipping problem

Post by Aelis440 »

For some reason, I cannot make my GUI Element ignore its parent's clipping rectangle. Here's what I got:

Code: Select all

	IGUITabControl* test = GUIEnv->addTabControl(rect<s32>(700, 50, 1200, 700));
	test->addTab(L"Movement");

	IGUIStaticText* moveForward = GUIEnv->addStaticText(L"Move Forward", rect<s32>(5, 5, 105, 25), false, false, test->getTab(0));

	rect<s32> editRect(460, 0, 480, 20);
	IGUIEditBox* moveForwardEdit = GUIEnv->addEditBox(L"W", editRect, false, moveForward, 100);
	moveForwardEdit->setNotClipped(true);

	//... every loop this is called:

	test->draw();
If you change the size of moveForward to say, 5, 5, 500, 25, you can then see the moveForwardEdit since it would then be inside the clipping rectangle of moveForward.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Why do you parent your elements then? Just draw it as a separate element. Parents will always clip their childs.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

I'd call that a bug. The non-clipped element isn't recalculating its clipping rectangle.

The quick fix is to call updateAbsolutePosition() on it, or one of its parents. Actually, I'd recommend calling test->updateAbsolutePosition() after you're finished adding elements.
Last edited by rogerborg on Mon Dec 15, 2008 4:12 pm, edited 1 time in total.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Who invented the noclip flag :o
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Bitplaaaaaaaaaaaaaaane! :)

(Actually, I'm just assuming, I didn't check the SVN blames)
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Yep, all my fault :oops:

Will move to bug reports and do something about it asap :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

update: I couldn't reproduce it with that test case, but I've added updateAbsolutePosition to setNotClipped anyway in case it shows up elsewhere
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply