GetLineCount() after GetTextDirection() returns wrong value. 49/217049/2
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 6 Nov 2019 01:57:57 +0000 (10:57 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Wed, 6 Nov 2019 02:01:30 +0000 (02:01 +0000)
ex)
   I expect the line count to come out of 3.
   However, after GetProperty(TEXT_DIRECTION), line count is 1.

   labelLine = TextLabel::New();
   labelLine.SetSize( 400, 200 );
   labelLine.SetParentOrigin(ParentOrigin::TOP_LEFT);
   labelLine.SetAnchorPoint(AnchorPoint::TOP_LEFT);
   labelLine.SetPosition( 830.f, 800.f);
   labelLine.SetProperty(TextLabel::Property::POINT_SIZE, 23.f);
   labelLine.SetProperty(Dali::Toolkit::TextLabel::Property::TEXT, "Original text Original text Original text Original text");
   labelLine.SetProperty( TextLabel::Property::MULTI_LINE, true );
   stage.Add( labelLine );

   stage.KeyEventSignal().Connect( this, &HelloWorldController::LineCount );

  void LineCount( const KeyEvent& event )
  {
    if( event.state == KeyEvent::Down )
    {
      // issue
      labelLine.SetProperty(Dali::Toolkit::TextLabel::Property::TEXT, "Changed1 text Changed text Changed text Changed text");
      DALI_LOG_ERROR("lineCount #11: %d \n",labelLine.GetProperty<int>( TextLabel::Property::LINE_COUNT ));
      labelLine.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION );
      DALI_LOG_ERROR("lineCount #22: %d \n",labelLine.GetProperty<int>( TextLabel::Property::LINE_COUNT ));

    }
  }

Change-Id: I197b97aa6f131930627bbef0438950c9679fd58f

dali-toolkit/internal/text/text-controller.cpp

index f82eada..139fbfd 100755 (executable)
@@ -2459,6 +2459,9 @@ Toolkit::DevelText::TextDirection::Type Controller::GetTextDirection()
     // Clear the update info. This info will be set the next time the text is updated.
     mImpl->mTextUpdateInfo.Clear();
 
     // Clear the update info. This info will be set the next time the text is updated.
     mImpl->mTextUpdateInfo.Clear();
 
+    // FullRelayoutNeeded should be true because DoRelayout is MAX_FLOAT, MAX_FLOAT.
+    mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true;
+
     mImpl->mUpdateTextDirection = false;
   }
 
     mImpl->mUpdateTextDirection = false;
   }