Change-Id: I478b27d3ca840a0f867415bf7326c658177e8fb4
{
mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET );
{
mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET );
- //resolveRtlPropertiesIfNeeded();
-
- int cacheIndex = -1; // = forceLayout ? -1 : mMeasureCache.indexOfKey(key);
- if( cacheIndex < 0 ) //|| sIgnoreMeasureCache )
- {
- // measure ourselves, this should set the measured dimension flag back
- OnMeasure( widthMeasureSpec, heightMeasureSpec );
- mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURE_NEEDED_BEFORE_LAYOUT );
- }
- else
- {
- mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_MEASURE_NEEDED_BEFORE_LAYOUT );
- }
+ // measure ourselves, this should set the measured dimension flag back
+ OnMeasure( widthMeasureSpec, heightMeasureSpec );
+ mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURE_NEEDED_BEFORE_LAYOUT );
// flag not set, setMeasuredDimension() was not invoked, we raise an exception to warn the developer
DALI_ASSERT_ALWAYS( mImpl->GetPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET ) &&
// flag not set, setMeasuredDimension() was not invoked, we raise an exception to warn the developer
DALI_ASSERT_ALWAYS( mImpl->GetPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET ) &&
mImpl->mOldWidthMeasureSpec = widthMeasureSpec;
mImpl->mOldHeightMeasureSpec = heightMeasureSpec;
mImpl->mOldWidthMeasureSpec = widthMeasureSpec;
mImpl->mOldHeightMeasureSpec = heightMeasureSpec;
-
- //mMeasureCache.put(key, ((long) mMeasuredWidth) << 32 | (long) mMeasuredHeight & 0xffffffffL); // suppress sign extension
}
void LayoutItem::Layout( LayoutLength l, LayoutLength t, LayoutLength r, LayoutLength b )
}
void LayoutItem::Layout( LayoutLength l, LayoutLength t, LayoutLength r, LayoutLength b )
LayoutLength& operator=(const LayoutLength& rhs)
{
LayoutLength& operator=(const LayoutLength& rhs)
{
+ if( this != &rhs )
+ {
+ mValue = rhs.mValue;
+ }
MeasureSpec& operator=( const MeasureSpec& rhs )
{
MeasureSpec& operator=( const MeasureSpec& rhs )
{
- this->mSize = rhs.mSize;
- this->mMode = rhs.mMode;
+ if( this != &rhs )
+ {
+ this->mSize = rhs.mSize;
+ this->mMode = rhs.mMode;
+ }
MeasuredSize& operator=( const MeasuredSize& rhs )
{
MeasuredSize& operator=( const MeasuredSize& rhs )
{
- this->mMeasuredSize = rhs.mMeasuredSize;
- this->mState = rhs.mState;
+ if( this != &rhs )
+ {
+ this->mMeasuredSize = rhs.mMeasuredSize;
+ this->mState = rhs.mState;
+ }
// scale to fit the padded area
auto finalSize =
// scale to fit the padded area
auto finalSize =
- naturalSize * std::min((paddedSize.width / naturalSize.width), (paddedSize.height / naturalSize.height));
+ naturalSize * std::min( ( naturalSize.width ? ( paddedSize.width / naturalSize.width ) : 0 ),
+ ( naturalSize.height ? ( paddedSize.height / naturalSize.height ) : 0 ) );
// calculate final offset within the padded area
auto finalOffset = Vector2(padding.start, padding.top) + (paddedSize - finalSize) * .5f;
// calculate final offset within the padded area
auto finalOffset = Vector2(padding.start, padding.top) + (paddedSize - finalSize) * .5f;