diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-04-15 22:14:10 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-04-15 22:24:24 +0300 |
commit | 7c02008e74a5dc4b663fcf8eb18b6baac6ed3bb2 (patch) | |
tree | 5a3b3be317013e4a55fd49ecf1a1a4e54e8e6fd0 /source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl | |
parent | 35ff9e44caa1a6fdcc5347c57bf10502f3f0d0ec (diff) |
Fix button triangle for "hold action" not working
There is quite some mess going on in that most of the old triangle
drawing code is still there, but does almost nothing effectively.
Instead values are hardcoded in the shader, however it doesn't support
the drawing options the triangle functions expose.
E.g. the 'where' variable to set triangle direction doesn't work.
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl index 0c351a3bce4..1c8c0ad3850 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl @@ -47,7 +47,7 @@ const vec2 jit[9] = vec2[9]( /* We can reuse the CORNER_* bits for tria */ #define TRIA_VEC_RANGE BIT_RANGE(6) -const vec2 triavec[34] = vec2[34]( +const vec2 triavec[37] = vec2[37]( /* horizontal tria */ vec2(-0.352077, 0.532607), vec2(-0.352077, -0.549313), vec2( 0.330000, -0.008353), vec2( 0.352077, 0.532607), vec2( 0.352077, -0.549313), vec2(-0.330000, -0.008353), @@ -66,7 +66,14 @@ const vec2 triavec[34] = vec2[34]( vec2(0.0, -0.82), vec2(-0.33, -0.16), vec2(0.33, -0.16), /* check mark */ vec2(-0.578579, 0.253369), vec2(-0.392773, 0.412794), vec2(-0.004241, -0.328551), - vec2(-0.003001, 0.034320), vec2(1.055313, 0.864744), vec2(0.866408, 1.026895) + vec2(-0.003001, 0.034320), vec2(1.055313, 0.864744), vec2(0.866408, 1.026895), + /* hold action arrow */ +#define OY -0.2 +#define SC 0.35 +// vec2(-0.5 + SC, 1.0 + OY), vec2( 0.5, 1.0 + OY), vec2( 0.5, 0.0 + OY + SC), + vec2( 0.5 - SC, 1.0 + OY), vec2(-0.5, 1.0 + OY), vec2(-0.5, 0.0 + OY + SC) +#undef OY +#undef SC ); uniform mat4 ModelViewProjectionMatrix; @@ -183,4 +190,4 @@ void main() v += jit[(vflag >> JIT_OFS) & JIT_RANGE]; gl_Position = ModelViewProjectionMatrix * vec4(v, 0.0, 1.0); -}
\ No newline at end of file +} |