GPencil: Fix crash when using circle or rectangle tool
This was caused by a wrongly sized vertex buffer for the stroke buffer.
This commit is contained in:
parent
e2d06eb68a
commit
5d5e0f1b0e
Notes:
blender-bot
2023-02-14 10:11:49 +01:00
Referenced by issue #102060, Smooth modifier does not work in spline curve mode
|
@ -629,9 +629,9 @@ static void gpencil_sbuffer_stroke_ensure(bGPdata *gpd, bool do_fill)
|
|||
GPUVertFormat *format_color = gpencil_color_format();
|
||||
GPUVertBuf *vbo = GPU_vertbuf_create_with_format_ex(format, vbo_flag);
|
||||
GPUVertBuf *vbo_col = GPU_vertbuf_create_with_format_ex(format_color, vbo_flag);
|
||||
/* Add extra space at the end the buffer because of quad load and cyclic. */
|
||||
GPU_vertbuf_data_alloc(vbo, vert_len + 2);
|
||||
GPU_vertbuf_data_alloc(vbo_col, vert_len + 2);
|
||||
/* Add extra space at the start and end the buffer because of quad load and cyclic. */
|
||||
GPU_vertbuf_data_alloc(vbo, 1 + vert_len + 1 + 2);
|
||||
GPU_vertbuf_data_alloc(vbo_col, 1 + vert_len + 1 + 2);
|
||||
gpStrokeVert *verts = (gpStrokeVert *)GPU_vertbuf_get_data(vbo);
|
||||
gpColorVert *cols = (gpColorVert *)GPU_vertbuf_get_data(vbo_col);
|
||||
|
||||
|
|
Loading…
Reference in New Issue