Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_graph/space_graph.c
| Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | if (ANIM_animdata_get_context(C, &ac)) { | ||||
| /* XXX(ton): the slow way to set tot rect... but for nice sliders needed. */ | /* XXX(ton): the slow way to set tot rect... but for nice sliders needed. */ | ||||
| get_graph_keyframe_extents( | get_graph_keyframe_extents( | ||||
| &ac, &v2d->tot.xmin, &v2d->tot.xmax, &v2d->tot.ymin, &v2d->tot.ymax, false, true); | &ac, &v2d->tot.xmin, &v2d->tot.xmax, &v2d->tot.ymin, &v2d->tot.ymax, false, true); | ||||
| /* extra offset so that these items are visible */ | /* extra offset so that these items are visible */ | ||||
| v2d->tot.xmin -= 10.0f; | v2d->tot.xmin -= 10.0f; | ||||
| v2d->tot.xmax += 10.0f; | v2d->tot.xmax += 10.0f; | ||||
| } | } | ||||
| if (((sipo->flag & SIPO_NODRAWCURSOR) == 0) || (sipo->mode == SIPO_MODE_DRIVERS)) { | if (((sipo->flag & SIPO_NODRAWCURSOR) == 0)) { | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | ||||
| /* horizontal component of value-cursor (value line before the current frame line) */ | /* horizontal component of value-cursor (value line before the current frame line) */ | ||||
| if ((sipo->flag & SIPO_NODRAWCURSOR) == 0) { | |||||
| float y = sipo->cursorVal; | float y = sipo->cursorVal; | ||||
| /* Draw a green line to indicate the cursor value */ | /* Draw a line to indicate the cursor value. */ | ||||
| immUniformThemeColorShadeAlpha(TH_CFRAME, -10, -50); | immUniformThemeColorShadeAlpha(TH_CFRAME, -10, -50); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| GPU_line_width(2.0); | GPU_line_width(2.0); | ||||
| immBegin(GPU_PRIM_LINES, 2); | immBegin(GPU_PRIM_LINES, 2); | ||||
| immVertex2f(pos, v2d->cur.xmin, y); | immVertex2f(pos, v2d->cur.xmin, y); | ||||
| immVertex2f(pos, v2d->cur.xmax, y); | immVertex2f(pos, v2d->cur.xmax, y); | ||||
| immEnd(); | immEnd(); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | |||||
| /* current frame or vertical component of vertical component of the cursor */ | /* Vertical component of of the cursor. */ | ||||
| if (sipo->mode == SIPO_MODE_DRIVERS) { | if (sipo->mode == SIPO_MODE_DRIVERS) { | ||||
| /* cursor x-value */ | /* cursor x-value */ | ||||
| float x = sipo->cursorTime; | float x = sipo->cursorTime; | ||||
| /* to help differentiate this from the current frame, | /* to help differentiate this from the current frame, | ||||
| * draw slightly darker like the horizontal one */ | * draw slightly darker like the horizontal one */ | ||||
| immUniformThemeColorShadeAlpha(TH_CFRAME, -40, -50); | immUniformThemeColorShadeAlpha(TH_CFRAME, -40, -50); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| ▲ Show 20 Lines • Show All 634 Lines • Show Last 20 Lines | |||||