X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=9e1d0dc4f46d7efc2880684c0ffe5b4958159ed2;hp=96a2dc31762ddde5106fed60c44c15c57026989a;hb=c156fa43a739e26d4d1ad187848968248078839f;hpb=2af20bd47b6f3ed138d87d4ddb0d458ae8b8f3e3 diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 96a2dc3..9e1d0dc 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -40,7 +40,6 @@ namespace #endif const float MAX_FLOAT = std::numeric_limits::max(); -const unsigned int POINTS_PER_INCH = 72; const std::string EMPTY_STRING(""); @@ -491,15 +490,6 @@ void Controller::SetDefaultPointSize( float pointSize ) mImpl->mFontDefaults->mDefaultPointSize = pointSize; mImpl->mFontDefaults->sizeDefined = true; - unsigned int horizontalDpi( 0u ); - unsigned int verticalDpi( 0u ); - mImpl->mFontClient.GetDpi( horizontalDpi, verticalDpi ); - - // Adjust the metrics if the fixed-size font should be down-scaled - int maxEmojiSize( pointSize/POINTS_PER_INCH * verticalDpi ); - DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetDefaultPointSize %p setting MaxEmojiSize %d\n", this, maxEmojiSize ); - mImpl->mMetrics->SetMaxEmojiSize( maxEmojiSize ); - // Clear the font-specific data ClearFontData(); @@ -1389,17 +1379,18 @@ float Controller::GetHeightForWidth( float width ) return layoutSize.height; } -bool Controller::Relayout( const Size& size ) +Controller::UpdateTextType Controller::Relayout( const Size& size ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f, autoScroll[%s]\n", this, size.width, size.height, (mImpl->mAutoScrollEnabled)?"true":"false" ); + UpdateTextType updateTextType = NONE_UPDATED; + if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) ) { - bool glyphsRemoved( false ); if( 0u != mImpl->mVisualModel->mGlyphPositions.Count() ) { mImpl->mVisualModel->mGlyphPositions.Clear(); - glyphsRemoved = true; + updateTextType = MODEL_UPDATED; } // Clear the update info. This info will be set the next time the text is updated. @@ -1408,7 +1399,7 @@ bool Controller::Relayout( const Size& size ) // Not worth to relayout if width or height is equal to zero. DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::Relayout (skipped)\n" ); - return glyphsRemoved; + return updateTextType; } // Whether a new size has been set. @@ -1447,6 +1438,11 @@ bool Controller::Relayout( const Size& size ) mImpl->mOperationsPending, layoutSize ) || updated; + if( updated ) + { + updateTextType = MODEL_UPDATED; + } + // Do not re-do any operation until something changes. mImpl->mOperationsPending = NO_OPERATION; @@ -1478,14 +1474,17 @@ bool Controller::Relayout( const Size& size ) } // Move the cursor, grab handle etc. - updated = mImpl->ProcessInputEvents() || updated; + if( mImpl->ProcessInputEvents() ) + { + updateTextType = static_cast( updateTextType | DECORATOR_UPDATED ); + } } // Clear the update info. This info will be set the next time the text is updated. mImpl->mTextUpdateInfo.Clear(); DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::Relayout\n" ); - return updated; + return updateTextType; } void Controller::ProcessModifyEvents() @@ -2571,7 +2570,10 @@ void Controller::TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Butt case Toolkit::TextSelectionPopup::COPY: { mImpl->SendSelectionToClipboard( false ); // Text not modified - mImpl->RequestRelayout(); // Handles, Selection Highlight, Popup + + mImpl->mEventData->mUpdateCursorPosition = true; + + mImpl->RequestRelayout(); // Cursor, Handles, Selection Highlight, Popup break; } case Toolkit::TextSelectionPopup::PASTE: @@ -2657,7 +2659,6 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons mImpl->mEventData->mScrollAfterDelete = true; requestRelayout = true; - retrieveCursor = true; } break; }