Fix T70887: GPencil edit lines are not displayed in the right place

The lines were not using the matrix to calc the tarnsformation.
This commit is contained in:
Antonio Vazquez 2019-10-17 11:15:22 +02:00
parent 74db523a52
commit 2afbd14c59
Notes: blender-bot 2023-02-14 06:25:25 +01:00
Referenced by issue #70887, GPencil: Edit lines are not displayed in the right place when the drawing plane is View or Cursor
1 changed files with 2 additions and 0 deletions

View File

@ -1286,12 +1286,14 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache,
if (!stl->g_data->shgrps_edit_line) {
stl->g_data->shgrps_edit_line = DRW_shgroup_create(e_data->gpencil_line_sh,
psl->edit_pass);
DRW_shgroup_uniform_mat4(stl->g_data->shgrps_edit_line, "gpModelMatrix", ob->obmat);
}
if (!stl->g_data->shgrps_edit_point) {
stl->g_data->shgrps_edit_point = DRW_shgroup_create(e_data->gpencil_edit_point_sh,
psl->edit_pass);
const float *viewport_size = DRW_viewport_size_get();
DRW_shgroup_uniform_vec2(stl->g_data->shgrps_edit_point, "Viewport", viewport_size, 1);
DRW_shgroup_uniform_mat4(stl->g_data->shgrps_edit_point, "gpModelMatrix", ob->obmat);
}
gpencil_add_editpoints_vertexdata(cache, ob, gpd, gpl, gpf, gps);