TextFit : modified it work even if you change the size 34/222234/1
authorJoogab Yun <joogab.yun@samsung.com>
Sat, 11 Jan 2020 22:37:02 +0000 (07:37 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Sat, 11 Jan 2020 22:37:02 +0000 (07:37 +0900)
commitb6b6084f70d5e79c42cdb86cc0cad13c8566c0fe
tree735f19b4b7695169dc23c016d4deee44560c770f
parent9d6e4837950a2c37d24da7de1ad823f1c75ad5f4
TextFit : modified it work even if you change the size

 // text fit test
   Property::Map backgroundMap;
   backgroundMap["color"] = Color::RED;
   backgroundMap["enable"] = true;

   Property::Map textFitMap;
   textFitMap["enable"] = true;
   textFitMap["minSize"] = 10.f;
   textFitMap["maxSize"] = 60.f;
   textFitMap["stepSize"] = 4.f;
   textFitMap["fontSizeType"] = "pointSize";

   width = 700;
   height = 100;
   textFit = TextLabel::New(  "Long enough message for TextLabel!! This is a Text Fit sample text " );
   textFit.SetSize( width, height );
   textFit.SetParentOrigin(ParentOrigin::TOP_LEFT);
   textFit.SetAnchorPoint(AnchorPoint::TOP_LEFT);
   textFit.SetPosition( 100.f, 300.f);
   textFit.SetProperty( Toolkit::DevelTextLabel::Property::TEXT_FIT, textFitMap );
   textFit.SetProperty( Toolkit::DevelTextLabel::Property::BACKGROUND, backgroundMap );
   stage.Add( textFit );

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

  void OnKeyEvent( const KeyEvent& event )
  {
    if( event.state == KeyEvent::Down )
    {
      width -= 40;
      textFit.SetSize( width, height );
    }
  }

Change-Id: Ie7f3cd5cc5e0fa581f8e4912ccb5e88049499f31
dali-toolkit/internal/text/text-controller.cpp