Vector3::GetVectorXY() returns a ref (or a const ref). This is problematic in the files in this
patch because they are returning a ref to a temporary variable which then goes out-of-scope later
The fix is to just create a copy of the value on the stack rather than pass a ref to the temporary
variable.
Change-Id: I2e93748943487a677d394064b70c2b6afe983dbf
void TextLabel::SetUpAutoScrolling()
{
- const Size& controlSize = mController->GetView().GetControlSize();
- const Size& offScreenSize = GetNaturalSize().GetVectorXY(); // As relayout of text may not be done at this point natural size is used to get size. Single line scrolling only.
+ const Size& controlSize = mController->GetView().GetControlSize(); // Needs to be a ref as the control-size can be changed by GetNaturalSize()
+ const Size offScreenSize = GetNaturalSize().GetVectorXY(); // As relayout of text may not be done at this point natural size is used to get size. Single line scrolling only.
const Vector2& alignmentOffset = mController->GetAlignmentOffset();
const Text::CharacterDirection direction = mController->GetAutoScrollDirection();
}
}
- const Vector2& size = Self().GetCurrentSize().GetVectorXY();
- Vector2 halfSize = size * 0.5f;
+ const Vector2 halfSize = Self().GetCurrentSize().GetVectorXY() * 0.5f;
//the centre to "explode" the tiles outwards from
Vector3 centre( halfSize.x, halfSize.y, -1.0f / mDisplacementSpreadFactor );
void CubeTransitionCrossEffect::SetupAnimation( unsigned int actorIndex, unsigned int x, unsigned int y, float angle, const Vector3 axis, const Vector3& displacementCentre )
{
- const Vector2& size = Self().GetCurrentSize().GetVectorXY();
+ const Vector2 size = Self().GetCurrentSize().GetVectorXY();
Vector2 halfSize = size * 0.5f;
//the position of the centre of the front face tile
void CubeTransitionWaveEffect::CalculateSaddleSurfaceParameters( Vector2 position, Vector2 displacement )
{
- const Vector2& size = Self().GetCurrentSize().GetVectorXY();
+ const Vector2 size = Self().GetCurrentSize().GetVectorXY();
// the line passes through 'position' and has the direction of 'displacement'
float coefA, coefB, coefC; //line equation: Ax+By+C=0;
coefA = displacement.y;