" highp vec2 dir = delta.xy * pos.w - pos.xy * delta.w; \n"
" highp vec2 ndir = .5 * pixelSize * normalize(dir / pixelSize); \n"
" dir -= ndir * delta.w * pos.w; \n"
- " highp float scale = min(1., dot(dir, ndir * pos.w * pos.w) / dot(dir, dir)); \n"
- " if (scale < 0.) scale = 1.; \n"
+ " highp float numerator = dot(dir, ndir * pos.w * pos.w); \n"
+ " highp float scale = 0.0; \n"
+ " if (numerator < 0.0) \n"
+ " scale = 1.0; \n"
+ " else \n"
+ " scale = min(1.0, numerator / dot(dir, dir)); \n"
" gl_Position += scale * delta; \n"
" texCoord.x += scale * texCoordOffset.x; \n"
" } \n"
" highp vec2 dir = delta.xy * pos.w - pos.xy * delta.w; \n"
" highp vec2 ndir = .5 * pixelSize * normalize(dir / pixelSize); \n"
" dir -= ndir * delta.w * pos.w; \n"
- " highp float scale = min(1., dot(dir, ndir * pos.w * pos.w) / dot(dir, dir)); \n"
- " if (scale < 0.) scale = 1.; \n"
+ " highp float numerator = dot(dir, ndir * pos.w * pos.w); \n"
+ " highp float scale = 0.0; \n"
+ " if (numerator < 0.0) \n"
+ " scale = 1.0; \n"
+ " else \n"
+ " scale = min(1.0, numerator / dot(dir, dir)); \n"
" gl_Position += scale * delta; \n"
" texCoord.y += scale * texCoordOffset.y; \n"
" } \n"
" highp vec2 dir = delta.xy * pos.w - pos.xy * delta.w; \n"
" highp vec2 ndir = .5 * pixelSize * normalize(dir / pixelSize); \n"
" dir -= ndir * delta.w * pos.w; \n"
- " highp float scale = min(1., dot(dir, ndir * pos.w * pos.w) / dot(dir, dir)); \n"
- " if (scale < 0.) scale = 1.; \n"
+ " highp float numerator = dot(dir, ndir * pos.w * pos.w); \n"
+ " highp float scale = 0.0; \n"
+ " if (numerator < 0.0) \n"
+ " scale = 1.0; \n"
+ " else \n"
+ " scale = min(1.0, numerator / dot(dir, dir)); \n"
" gl_Position += scale * delta; \n"
" } \n"
" highp vec2 dir = delta.xy * pos.w - pos.xy * delta.w; \n"
" highp vec2 ndir = .5 * pixelSize * normalize(dir / pixelSize); \n"
" dir -= ndir * delta.w * pos.w; \n"
- " highp float scale = min(1., dot(dir, ndir * pos.w * pos.w) / dot(dir, dir)); \n"
- " if (scale < 0.) scale = 1.; \n"
+ " highp float numerator = dot(dir, ndir * pos.w * pos.w); \n"
+ " highp float scale = 0.0; \n"
+ " if (numerator < 0.0) \n"
+ " scale = 1.0; \n"
+ " else \n"
+ " scale = min(1.0, numerator / dot(dir, dir)); \n"
" gl_Position += scale * delta; \n"
" } \n"