From: Sara Samara Date: Wed, 15 Sep 2021 10:29:23 +0000 (+0300) Subject: Fixing Bug: Caret is too big with LineSpacing X-Git-Tag: dali_2.1.3~1^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=7956f5a39044145c9f6af24fa6d291a9943800cf;hp=7956f5a39044145c9f6af24fa6d291a9943800cf Fixing Bug: Caret is too big with LineSpacing *********************************************************** Description When using LineSpacing or MinLineSize the caret size is too big and does not look good. The primary cursor height was obtaining its height from the line height (which includes the line spacing). I've modified it to obtain the height from the default font height. Please use the code below to test the issue and its fix. *********************************************************** using namespace Dali; using namespace Dali::Toolkit; class SimpleApp : public ConnectionTracker { public: SimpleApp(Application& application) : mApplication(application) { mApplication.InitSignal().Connect(this, &SimpleApp::Create); } void Create(Application& application) { Window window = application.GetWindow(); window.SetBackgroundColor(Vector4(0.04f, 0.345f, 0.392f, 1.0f)); mEditor = TextEditor::New(); mEditor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER); mEditor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER); mEditor.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.0f, 0.f)); mEditor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 100.0f)); mEditor.SetProperty(TextEditor::Property::TEXT, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n"); mEditor.SetProperty(TextEditor::Property::ENABLE_MARKUP, true); mEditor.SetProperty(TextEditor::Property::POINT_SIZE, 40.0f); mEditor.SetBackgroundColor(Color::WHITE); mEditor.SetProperty( DevelTextEditor::Property::MIN_LINE_SIZE, 50.f ); window.Add(mEditor); } bool OnButtonClicked(Button button) { if(button == mButton) { Vector3 originalSize = mEditor.GetNaturalSize(); } return true; } private: Application &mApplication; TextEditor mEditor; PushButton mButton; TextField mField; }; int DALI_EXPORT_API main(int argc, char** argv) { Application application = Application::New(&argc, &argv); SimpleApp test(application); application.MainLoop(); return 0; } Change-Id: I8d8accbef03b69ba4e77f4f891bae08e37f93a00 ---