X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-scroller.cpp;h=4ca011e9664f35cc6cad4015cf10bbc96f061acd;hb=35bad7cc4cc49975d6af559b1cd45b014046a2d6;hp=a1bb52ae443859abf249c1c319be64acaacce17a;hpb=b5b774f066e74e54a2e6f4bf923d1501f21f1284;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp index a1bb52a..4ca011e 100644 --- a/dali-toolkit/internal/text/text-scroller.cpp +++ b/dali-toolkit/internal/text/text-scroller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -80,13 +80,6 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( uniform sampler2D sTexture;\n uniform lowp vec4 uColor;\n uniform lowp vec3 mixColor;\n - uniform lowp float opacity;\n - uniform lowp float preMultipliedAlpha;\n - \n - lowp vec4 visualMixColor()\n - {\n - return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n - }\n \n void main()\n {\n @@ -94,9 +87,8 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( discard;\n \n mediump vec4 textTexture = texture2D( sTexture, vTexCoord );\n - textTexture.rgb *= mix( 1.0, textTexture.a, preMultipliedAlpha );\n \n - gl_FragColor = textTexture * uColor * visualMixColor(); + gl_FragColor = textTexture * uColor * vec4( mixColor, 1.0 ); }\n ); @@ -257,7 +249,7 @@ TextScroller::~TextScroller() { } -void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, TextureSet textureSet, const Size& controlSize, const Size& textureSize, const float wrapGap, CharacterDirection direction, HorizontalAlignment::Type horizontalAlignment, VerticalAlignment::Type verticalAlignment, bool isTextElided ) +void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, TextureSet textureSet, const Size& controlSize, const Size& textureSize, const float wrapGap, CharacterDirection direction, HorizontalAlignment::Type horizontalAlignment, VerticalAlignment::Type verticalAlignment ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters controlSize[%f,%f] textureSize[%f,%f] direction[%d]\n", controlSize.x, controlSize.y, textureSize.x, textureSize.y, direction ); @@ -297,7 +289,7 @@ void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, T float horizontalAlign; - if( isTextElided ) + if( textureSize.x > controlSize.x ) { // if Text is elided, scroll should start at the begin of text. horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[HorizontalAlignment::BEGIN][ direction ]; @@ -306,7 +298,9 @@ void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, T { horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[ horizontalAlignment ][ direction ]; } + const float verticalAlign = VERTICAL_ALIGNMENT_TABLE[ verticalAlignment ]; + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters horizontalAlign[%f], verticalAlign[%f]\n", horizontalAlign, verticalAlign ); scrollingTextActor.RegisterProperty( "uTextureSize", textureSize );