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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user