Fix visual defect during text scroll
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / graphics / shaders / gradient-visual-shader.frag
index 892035e..a30bf5e 100644 (file)
@@ -121,6 +121,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
   {
     // potential is inside borderline range.
     borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential);
+
+    // Muliply borderlineWidth to resolve very thin borderline
+    borderlineOpacity *= min(1.0, borderlineWidth);
   }
 
   lowp vec3  borderlineColorRGB   = borderlineColor.rgb * uActorColor.rgb;
@@ -204,18 +207,23 @@ void main()
   if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
   {
     OUT_COLOR = textureColor;
-    return;
   }
-  PreprocessPotential();
+  else
+  {
+    PreprocessPotential();
 #endif
 
 #if IS_REQUIRED_BORDERLINE
-  textureColor = convertBorderlineColor(textureColor);
+    textureColor = convertBorderlineColor(textureColor);
 #endif
-  OUT_COLOR = textureColor;
+    OUT_COLOR = textureColor;
 
 #if IS_REQUIRED_ROUNDED_CORNER
-  mediump float opacity = calculateCornerOpacity();
-  OUT_COLOR *= opacity;
+    mediump float opacity = calculateCornerOpacity();
+    OUT_COLOR *= opacity;
+#endif
+
+#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+  }
 #endif
 }