Fix T84784: Time Remapping not displaying in the timeline

Caused by rBbbb2e0614fc3.

Oversight to not take the remapped framelength into account.

Maniphest Tasks: T84784

Differential Revision: https://developer.blender.org/D10134
This commit is contained in:
Philipp Oeser 2021-01-18 12:02:45 +01:00
parent 36f0a1ead7
commit c371d699ca
Notes: blender-bot 2023-02-14 06:49:57 +01:00
Referenced by issue #84784, Regression: Time Remapping not displaying in the timeline anymore (displays wrong frame)
1 changed files with 2 additions and 3 deletions

View File

@ -22,6 +22,7 @@
*/
#include "BKE_context.h"
#include "BKE_scene.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
@ -91,7 +92,6 @@ static void draw_current_frame(const Scene *scene,
const View2D *v2d,
const rcti *scrub_region_rect,
int current_frame,
float sub_frame,
bool draw_line)
{
const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
@ -109,7 +109,7 @@ static void draw_current_frame(const Scene *scene,
if (draw_line) {
/* Draw vertical line to from the bottom of the current frame box to the bottom of the screen.
*/
const float subframe_x = UI_view2d_view_to_region_x(v2d, current_frame + sub_frame);
const float subframe_x = UI_view2d_view_to_region_x(v2d, BKE_scene_frame_get(scene));
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@ -168,7 +168,6 @@ void ED_time_scrub_draw_current_frame(const ARegion *region,
v2d,
&scrub_region_rect,
scene->r.cfra,
scene->r.subframe,
draw_line);
GPU_matrix_pop_projection();
}