[Solved] Cloning windows sets rotation

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

User avatar
ErikHjortsberg
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Jan 23, 2005 12:45
Location: Sweden
Contact:

[Solved] Cloning windows sets rotation

Postby ErikHjortsberg » Wed Nov 26, 2014 09:27

When you clone a window, all of the properties from the source window are cloned to the new window.
This includes intrinsic properties as defined in Element::addElementProperties().
Amongst these is "Rotation".
However, when the rotation is set this results in Window::onRotated being called, and this in turn turns on autorender surface support, even though the rotation is identity rotation.
The end result of this is that all cloned elements (and their children if you want a deep clone) gets autorender surface support. Which you don't want.

So, there are a couple of different solutions to this:
* alter Window::onRotated to only turn on autorender surface support if rotation is other than identity
* alter Element::setRotation to only call into onRotated if the new rotation differs from the existing rotation
* alter Window::clonePropertiesTo to only call target.setProperty if the property is different

The first two are easiest, but I'm thinking that this might affect other intrinsic properties than Render, which makes the last approach perhaps the most solid.
Thoughts?
Ember, a client for the Worldforge system.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Cloning windows sets rotation

Postby Ident » Wed Nov 26, 2014 20:32

We will probably use the first for v0-8

Code: Select all

[14:00:45]   mpreisler   Ident: I think the first solution is the cleanest and least intrusive for the v0-8 branch
[14:01:16]   mpreisler   with numeric_limits we should be able to figure out a good range test for the quaternion
[14:01:26]   mpreisler   we will of course never turn ARS off


We should probably fix this soon and we need a good solution for default branch as well.
CrazyEddie: "I don't like GUIs"

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Cloning windows sets rotation

Postby Kulik » Sat Nov 29, 2014 17:36

Fixed with https://bitbucket.org/cegui/cegui/commi ... 78d56a956b

Testing from within CEED but would appreciate a confirmation that this issue is fixed for your use-case.

User avatar
ErikHjortsberg
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Jan 23, 2005 12:45
Location: Sweden
Contact:

Re: Cloning windows sets rotation

Postby ErikHjortsberg » Thu Dec 04, 2014 21:04

Yep, this fixes the issue. Thanks!
Ember, a client for the Worldforge system.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 10 guests