From: Adeel Kazmi Date: Thu, 23 Jan 2020 17:28:44 +0000 (+0000) Subject: Only change the resize policy to fixed if we haven't set the resize policy before X-Git-Tag: dali_1.4.56~2^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-core.git;a=commitdiff_plain;h=9b0f406ee1d9ca12319c09746e3967f1f3fa840b Only change the resize policy to fixed if we haven't set the resize policy before Change-Id: I0322a8b50a22a5f5b2dcf13da763f66ee6ae979a --- diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index 23c7977..ed576d1 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -4638,8 +4638,19 @@ void Actor::SetPreferredSize( const Vector2& size ) { EnsureRelayoutData(); - SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH ); - SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT ); + // If valid width or height, then set the resize policy to FIXED + // A 0 width or height may also be required so if the resize policy has not been changed, i.e. is still set to DEFAULT, + // then change to FIXED as well + + if( size.width > 0.0f || GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::DEFAULT ) + { + SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH ); + } + + if( size.height > 0.0f || GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::DEFAULT ) + { + SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT ); + } mRelayoutData->preferredSize = size;