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:
authorAntonioya <blendergit@gmail.com>2019-07-21 00:01:19 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-07-30 18:11:56 +0300
commit7f29fc7415a49d5688efbe10fa0a81b174d49435 (patch)
tree5feca8d0936990eb434cd860e716fc7316773bfb /source/blender/makesdna/DNA_gpencil_types.h
parentf69e57a53fab92d549a90a0198b86ff766ba0da2 (diff)
Fix T65691: GPencil Drawing long strokes turn invisible
There was a fixed limit to the number of points available in a buffer stroke. Now, the array is expanded as needed using a predefined number of points for each expansion, instead to add one by one. This is done to reduce the number of times the memory allocation is required. As part of the fix, some variables have been renamed to reflect better their use.
Diffstat (limited to 'source/blender/makesdna/DNA_gpencil_types.h')
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 307a6f2fe16..9134e603a87 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -412,7 +412,7 @@ typedef enum eGPLayerBlendModes {
typedef struct bGPdata_Runtime {
/** Last region where drawing was originated. */
struct ARegion *ar;
- /** Stroke buffer (can hold GP_STROKE_BUFFER_MAX). */
+ /** Stroke buffer. */
void *sbuffer;
/* GP Object drawing */
@@ -431,11 +431,13 @@ typedef struct bGPdata_Runtime {
* - buffer must be initialized before use, but freed after
* whole paint operation is over
*/
- /** Number of elements currently in cache. */
- short sbuffer_size;
+ /** Number of elements currently used in cache. */
+ short sbuffer_used;
/** Flags for stroke that cache represents. */
short sbuffer_sflag;
- char _pad[6];
+ /** Number of total elements available in cache. */
+ short sbuffer_size;
+ char _pad[4];
/** Number of control-points for stroke. */
int tot_cp_points;