X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Ftext-view%2Frelayout-utilities.cpp;h=17c9534393a3129a343957b77ce5621ac7f3134c;hp=dbec30e861013d6874819e3e2caf4348eff72cf8;hb=96d86697796ed385fa91e3319d0577ff8de92a17;hpb=92480e026ce2bfc7e2a5166b9097c31a37a84346 diff --git a/base/dali-toolkit/internal/controls/text-view/relayout-utilities.cpp b/base/dali-toolkit/internal/controls/text-view/relayout-utilities.cpp index dbec30e..17c9534 100644 --- a/base/dali-toolkit/internal/controls/text-view/relayout-utilities.cpp +++ b/base/dali-toolkit/internal/controls/text-view/relayout-utilities.cpp @@ -1,33 +1,29 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // FILE HEADER -#include "relayout-utilities.h" +#include + +// INTERNAL INCLUDES +#include // EXTERNAL INCLUDES #include -// INTERNAL INCLUDES -#include -#include -#include "text-view-line-processor.h" -#include "text-view-word-processor.h" -#include "text-view-processor-helper-functions.h" -#include "text-view-processor-dbg.h" - namespace Dali { @@ -1261,6 +1257,7 @@ void SetTextVisible( TextView::RelayoutData& relayoutData ) characterLayoutInfo.mGradientColor = Vector4::ZERO; characterLayoutInfo.mStartPoint = Vector2::ZERO; characterLayoutInfo.mEndPoint = Vector2::ZERO; + characterLayoutInfo.mColorAlpha = characterLayoutInfo.mStyledText.mStyle.GetTextColor().a; } // end characters } // end words } // end group of words @@ -1706,7 +1703,7 @@ void CalculateUnderlineInfo( TextView::RelayoutData& relayoutData, TextViewRelay ++textUnderlineStatus.mLineGlobalIndex; // If it's a new line, point to the next one. } - if( characterGroup.mStyledText.mStyle.GetUnderline() ) + if( characterGroup.mStyledText.mStyle.IsUnderlineEnabled() ) { if( !textUnderlineStatus.mCurrentUnderlineStatus || // Current character is underlined but previous one it wasn't. isNewLine ) // Current character is underlined and is the first of current laid-out line. @@ -1823,7 +1820,7 @@ void SetUnderlineInfo( TextView::RelayoutData& relayoutData ) } } - if( characterGroup.mStyledText.mStyle.GetUnderline() ) + if( characterGroup.mStyledText.mStyle.IsUnderlineEnabled() ) { if( textUnderlineStatus.mCurrentUnderlineStatus ) { @@ -1843,15 +1840,12 @@ void SetUnderlineInfo( TextView::RelayoutData& relayoutData ) textUnderlineStatus.mCurrentUnderlineStatus = true; - // Sets the underline's thickness. - characterGroup.mStyledText.mStyle.SetUnderlineThickness( underlineInfo.mMaxThickness ); - // Before setting the position it needs to be adjusted to match the base line. const float bearingOffset = ( currentLineHeight - currentLineAscender ) - ( characterGroup.mSize.height - characterGroup.mAscender ); const float positionOffset = ( underlineInfo.mMaxHeight - characterGroup.mSize.height ) - bearingOffset; - // Sets the underline's position. - characterGroup.mStyledText.mStyle.SetUnderlinePosition( underlineInfo.mPosition - positionOffset ); + // Sets the underline's parameters. + characterGroup.mStyledText.mStyle.SetUnderline( true, underlineInfo.mMaxThickness, underlineInfo.mPosition - positionOffset ); // Mark the group of characters to be set the new style into the text-actor. characterGroup.mSetStyle = true; @@ -1983,7 +1977,8 @@ RenderableActor CreateGlyphActor( const Text& text, const TextStyle& style, Text else { // The text-actor cache is empty. Create a new one. - textActor = TextActor::New( text, style, false, true ); + TextActorParameters parameters( style, TextActorParameters::FONT_DETECTION_OFF ); + textActor = TextActor::New( text, parameters ); } return textActor;