Merge "Fix Kloc issues." into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 29 Oct 2015 11:38:26 +0000 (04:38 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 29 Oct 2015 11:38:26 +0000 (04:38 -0700)
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/text-controller.cpp

index 12de684..fd0bcae 100644 (file)
@@ -282,7 +282,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr
         if( impl.mController )
         {
           float height = value.Get< float >();
-          if ( impl.mController->GetUnderlineHeight() != height )
+          if( fabsf( impl.mController->GetUnderlineHeight() - height ) > Math::MACHINE_EPSILON_1000 )
           {
             impl.mController->SetUnderlineHeight( height );
             impl.mRenderer.Reset();
index e4cef74..4444d0c 100644 (file)
@@ -38,9 +38,6 @@ namespace Toolkit
 namespace Internal
 {
 
-namespace
-{
-
 enum PopupCustomisations
 {
   POPUP_MAXIMUM_SIZE,
@@ -49,8 +46,6 @@ enum PopupCustomisations
   OPTION_DIVIDER_SIZE
 };
 
-} // namespace
-
 class TextSelectionPopup : public Control
 {
 public:
index 54a957c..ad513a8 100644 (file)
@@ -766,10 +766,12 @@ struct LayoutEngine::Impl
       {
         if( isLastLine && !isRTL )
         {
+          // Add the length of the white saces at the end of the line.
           lineLength += line.extraLength;
           if( lineLength > boxWidth )
           {
-            lineLength = boxWidth;
+            // The line's length is longer than the box's width.
+            // Set the line's offset to 0 and nothing else to do.
             line.alignmentOffset = 0.f;
             break;
           }
index 8653b43..5592589 100644 (file)
@@ -232,7 +232,7 @@ struct AtlasRenderer::Impl
           currentUnderlinePosition = ceil( fabsf( fontMetrics.underlinePosition ) );
           const float descender = ceil( fabsf( fontMetrics.descender ) );
 
-          if ( underlineHeight == ZERO )
+          if( fabsf( underlineHeight ) < Math::MACHINE_EPSILON_1000 )
           {
             currentUnderlineThickness = fontMetrics.underlineThickness;
 
@@ -252,7 +252,7 @@ struct AtlasRenderer::Impl
           {
             currentUnderlinePosition = descender;
           }
-          if ( ZERO == currentUnderlinePosition )
+          if( fabsf( currentUnderlinePosition ) < Math::MACHINE_EPSILON_1000 )
           {
             // Move offset down by one ( EFL behavior )
             currentUnderlinePosition = ONE;
index eddde06..f7958ff 100644 (file)
@@ -667,7 +667,7 @@ float Controller::GetHeightForWidth( float width )
   ProcessModifyEvents();
 
   Size layoutSize;
-  if( width != mImpl->mVisualModel->mControlSize.width )
+  if( fabsf( width - mImpl->mVisualModel->mControlSize.width ) > Math::MACHINE_EPSILON_1000 )
   {
     // Operations that can be done only once until the text changes.
     const OperationsMask onlyOnceOperations = static_cast<OperationsMask>( CONVERT_TO_UTF32  |