X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftext%2Ftext-visual.cpp;h=e9a32f62f68ed2b68310b56ef56e1a8705158c10;hp=a3057c3172503a965969395ba5f8537a7088f815;hb=54342c70a267a34b3345b24c404f1064fed99338;hpb=d402b997c5874a73bfec576eff290af235c1c03d diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index a3057c3..e9a32f6 100755 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -57,14 +58,14 @@ const Vector4 FULL_TEXTURE_RECT( 0.f, 0.f, 1.f, 1.f ); const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n uniform highp mat4 uMvpMatrix;\n - uniform mediump vec3 uSize;\n + uniform highp vec3 uSize;\n uniform mediump vec4 pixelArea;\n varying mediump vec2 vTexCoord;\n //Visual size and offset uniform mediump vec2 offset;\n - uniform mediump vec2 size;\n + uniform highp vec2 size;\n uniform mediump vec4 offsetSizeMode;\n uniform mediump vec2 origin;\n uniform mediump vec2 anchorPoint;\n @@ -421,7 +422,7 @@ void TextVisual::DoSetProperties( const Property::Map& propertyMap ) engine.SetCursorWidth( 0u ); // Do not layout space for the cursor. } -void TextVisual::DoSetOnStage( Actor& actor ) +void TextVisual::DoSetOnScene( Actor& actor ) { mControl = actor; @@ -476,7 +477,7 @@ void TextVisual::RemoveRenderer( Actor& actor ) mRendererList.clear(); } -void TextVisual::DoSetOffStage( Actor& actor ) +void TextVisual::DoSetOffScene( Actor& actor ) { RemoveRenderer( actor ); @@ -619,7 +620,16 @@ void TextVisual::UpdateRenderer() return; } - Dali::LayoutDirection::Type layoutDirection = static_cast( control.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); + + Dali::LayoutDirection::Type layoutDirection; + if( mController->IsMatchSystemLanguageDirection() ) + { + layoutDirection = static_cast( DevelWindow::Get( control ).GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); + } + else + { + layoutDirection = static_cast( control.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); + } const Text::Controller::UpdateTextType updateTextType = mController->Relayout( relayoutSize, layoutDirection ); @@ -820,8 +830,11 @@ void TextVisual::AddRenderer( Actor& actor, const Vector2& size, bool hasMultipl // Get the current offset for recalculate the offset when tiling. Property::Map retMap; mImpl->mTransform.GetPropertyMap( retMap ); - Vector2 offSet = retMap.Find( Dali::Toolkit::Visual::Transform::Property::OFFSET )->Get< Vector2 >(); - info.offSet = offSet; + Property::Value* offsetValue = retMap.Find( Dali::Toolkit::Visual::Transform::Property::OFFSET ); + if( offsetValue ) + { + offsetValue->Get( info.offSet ); + } // Create a textureset in the default renderer. CreateTextureSet( info, mImpl->mRenderer, sampler, hasMultipleTextColors, containsColorGlyph, styleEnabled );