TextSelection Popup to be aware of requirement to Paste and whitespace selectable
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / atlas / text-atlas-renderer.cpp
index 8653b43..4cb19ed 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;
@@ -720,6 +720,13 @@ Actor AtlasRenderer::Render( Text::ViewInterface& view, int depth )
                       positions,
                       glyphs,
                       depth );
+
+    /* In the case where AddGlyphs does not create a renderable Actor for example when glyphs are all whitespace create a new Actor.  */
+    /* This renderable actor is used to position the text, other "decorations" can rely on there always being an Actor regardless of it is whitespace or regular text*/
+    if ( !mImpl->mActor )
+    {
+      mImpl->mActor = Actor::New();
+    }
   }
 
   return mImpl->mActor;