// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/bidirectional-support.h>
Vector<Character>& srcCharacters = impl.mModel->mLogicalModel->mText;
Vector<Character> displayCharacters;
bool useHiddenText = false;
- if(impl.mHiddenInput && impl.mEventData != nullptr && !impl.mEventData->mIsShowingPlaceholderText)
+ if(impl.mHiddenInput && impl.mEventData != nullptr)
{
- impl.mHiddenInput->Substitute(srcCharacters, displayCharacters);
- useHiddenText = true;
+ if(impl.mEventData->mIsShowingPlaceholderText)
+ {
+ impl.mHiddenInput->InitPreviousTextCount();
+ }
+ else
+ {
+ impl.mHiddenInput->Substitute(srcCharacters, displayCharacters, impl.mEventData->mPrimaryCursorPosition);
+ useHiddenText = true;
+ }
}
Vector<Character>& utf32Characters = useHiddenText ? displayCharacters : srcCharacters;
updated = true;
}
- const Length numberOfGlyphs = glyphs.Count() - currentNumberOfGlyphs;
+ const Length numberOfGlyphs = static_cast<Length>(glyphs.Count()) - currentNumberOfGlyphs;
if(Controller::NO_OPERATION != (Controller::GET_GLYPH_METRICS & operations))
{
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
- if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled())
+ if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled() ||
+ impl.mModel->mLogicalModel->mUnderlineRunsUpdated)
{
impl.CopyUnderlinedFromLogicalToVisualModels(false);
}
impl.mModel->mLogicalModel->mBackgroundColorRuns.PushBack(backgroundColorRun);
Vector4 backgroundColor = impl.mModel->mVisualModel->GetBackgroundColor();
- if(backgroundColor.a == 0) // There is no text background color.
+ if(Dali::EqualsZero(backgroundColor.a)) // There is no text background color.
{
// Try use the control's background color.
if(nullptr != impl.mEditableControlInterface)
{
impl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
- if(backgroundColor.a == 0) // There is no control background color.
+ if(Dali::EqualsZero(backgroundColor.a)) // There is no control background color.
{
// Determines black or white color according to text color.
// Based on W3C Recommendations (https://www.w3.org/TR/WCAG20/)
impl.mModel->mLogicalModel->mColorRuns.PushBack(colorRun);
//Mark-up processor case
- if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled())
+ if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled() ||
+ impl.mModel->mLogicalModel->mUnderlineRunsUpdated)
{
impl.CopyUnderlinedFromLogicalToVisualModels(false);
}
impl.mModel->mLogicalModel->mBackgroundColorRuns.PushBack(backgroundColorRun);
//Mark-up processor case
- if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled())
+ if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled() ||
+ impl.mModel->mLogicalModel->mUnderlineRunsUpdated)
{
impl.CopyUnderlinedFromLogicalToVisualModels(false);
}
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
- if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled())
+ if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled() ||
+ impl.mModel->mLogicalModel->mUnderlineRunsUpdated)
{
impl.CopyUnderlinedFromLogicalToVisualModels(false);
}
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
- if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled())
+ if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled() ||
+ impl.mModel->mLogicalModel->mUnderlineRunsUpdated)
{
impl.CopyUnderlinedFromLogicalToVisualModels(false);
}
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
- if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled())
+ if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled() ||
+ impl.mModel->mLogicalModel->mUnderlineRunsUpdated)
{
impl.CopyUnderlinedFromLogicalToVisualModels(false);
}
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
- if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled())
+ if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled() ||
+ impl.mModel->mLogicalModel->mUnderlineRunsUpdated)
{
impl.CopyUnderlinedFromLogicalToVisualModels(false);
}
(0u != impl.mModel->mVisualModel->mCharactersToGlyph.Count())))
{
//Mark-up processor case
- if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled())
+ if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled() ||
+ impl.mModel->mLogicalModel->mUnderlineRunsUpdated ||
+ impl.mModel->mLogicalModel->mCharacterSpacingRunsUpdated ||
+ impl.mModel->mLogicalModel->mStrikethroughRunsUpdated)
{
impl.CopyUnderlinedFromLogicalToVisualModels(true);
impl.CopyStrikethroughFromLogicalToVisualModels();