Page 1 of 1

[Solved] Cloning windows sets rotation

Posted: Wed Nov 26, 2014 09:27
by ErikHjortsberg
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?

Re: Cloning windows sets rotation

Posted: Wed Nov 26, 2014 20:32
by Ident
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.

Re: Cloning windows sets rotation

Posted: Sat Nov 29, 2014 17:36
by Kulik
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.

Re: Cloning windows sets rotation

Posted: Thu Dec 04, 2014 21:04
by ErikHjortsberg
Yep, this fixes the issue. Thanks!