Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-11-19 22:57:05 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-11-19 22:57:05 +0300
commitfb0ea94c6303ce030c160fa33f24ee9527f453ba (patch)
tree5cc2c0c0e068dc8a3bd570839666bb51a8b0454a /source/blender/editors/space_graph
parent00e4d665f44ae63e6034b06b68729b78e9ac3131 (diff)
Fix T85855: F-curves too thin on Mac
Use the `GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR` shader instead of `GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR`. This is just a partial solution as "protected" fcurves still use the dashed shader. Differential Revision: https://developer.blender.org/D13290
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_draw.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index af88bbced9c..85d27075117 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -1060,21 +1060,21 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn
const uint shdr_pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
- immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
-
float viewport_size[4];
GPU_viewport_size_get_f(viewport_size);
- immUniform2f("viewport_size", viewport_size[2] / UI_DPI_FAC, viewport_size[3] / UI_DPI_FAC);
-
- immUniform1i("colors_len", 0); /* Simple dashes. */
if (BKE_fcurve_is_protected(fcu)) {
- /* protected curves (non editable) are drawn with dotted lines */
- immUniform1f("dash_width", 4.0f);
+ /* Protected curves (non editable) are drawn with dotted lines. */
+ immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
+ immUniform2f("viewport_size", viewport_size[2] / UI_DPI_FAC, viewport_size[3] / UI_DPI_FAC);
+ immUniform1i("colors_len", 0); /* Simple dashes. */
+ immUniform1f("dash_width", 4.0f * U.pixelsize);
immUniform1f("dash_factor", 0.5f);
}
else {
- immUniform1f("dash_factor", 2.0f); /* solid line */
+ immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR);
+ immUniform2fv("viewportSize", &viewport_size[2]);
+ immUniform1f("lineWidth", GPU_line_width_get());
}
if (((fcu->grp) && (fcu->grp->flag & AGRP_MUTED)) || (fcu->flag & FCURVE_MUTED)) {