[3.0] Fixed 9-patch rendering issue when applying a scale. 36/114036/5
authoradam.b <adam.b@samsung.com>
Thu, 9 Feb 2017 15:18:33 +0000 (15:18 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Thu, 9 Feb 2017 16:36:26 +0000 (08:36 -0800)
Integrating scale with size was causing a glitch
during scaling a 9-patch image (when scale < 1)

Change-Id: I1cee72cab42e9d828f312c3747a22e48347d5f50

dali-toolkit/internal/visuals/npatch/npatch-visual.cpp

index af36fb7..8a8b632 100644 (file)
@@ -84,7 +84,7 @@ const char* VERTEX_SHADER_3X3 = DALI_COMPOSE_SHADER(
     void main()\n
     {\n
       mediump vec2 scale        = vec2( length( uModelMatrix[ 0 ].xyz ), length( uModelMatrix[ 1 ].xyz ) );\n
-      mediump vec2 size         = uSize.xy * scale;\n
+      mediump vec2 size         = uSize.xy;\n
       \n
       mediump vec2 fixedFactor  = vec2( uFixed[ int( ( aPosition.x + 1.0 ) * 0.5 ) ].x, uFixed[ int( ( aPosition.y  + 1.0 ) * 0.5 ) ].y );\n
       mediump vec2 stretch      = floor( aPosition * 0.5 );\n
@@ -92,7 +92,7 @@ const char* VERTEX_SHADER_3X3 = DALI_COMPOSE_SHADER(
       \n
       mediump vec4 vertexPosition = vec4( fixedFactor + ( size - fixedTotal ) * stretch, 0.0, 1.0 );\n
       vertexPosition.xy -= size * vec2( 0.5, 0.5 );\n
-      vertexPosition.xy =  vertexPosition.xy / scale;\n
+      vertexPosition.xy =  vertexPosition.xy;\n
       \n
       vertexPosition = uMvpMatrix * vertexPosition;\n
       \n