/*
- * 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.
{
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;