Fix text written below cursor bug
***********************************************************
Description:
When we use different font sizes with min line size, text in the new line gets written below the cursor position.
Please use the code below to generate the issue.
***********************************************************
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( TextField::Property::TEXT, "H<span font-size='45' font-family='DejaVu Sans' font-width='condensed' font-slant='italic' text-color='red'>ello</span> Span\n <span font-size='50' text-color='red'>S</span> \n" );//issue here with the y position after the new line
mEditor.SetProperty(TextEditor::Property::ENABLE_MARKUP, true);
mEditor.SetProperty(TextEditor::Property::POINT_SIZE, 15.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: I2868f923e38d9ecc14bf738959f24be015b754fd