GPencil: Fix unreported random rotation for single point with texture

When using ``Path`` alignment, if the stroke has one point the texture rotates randomly when move the viewport. This was because with one point is impossible to calculate a path.

Now, if the stroke has only one point, the texture for this stroke is aligned to Object.
This commit is contained in:
Antonio Vazquez 2021-05-28 17:14:01 +02:00
parent c369382977
commit 3c02e648f3
1 changed files with 4 additions and 0 deletions

View File

@ -442,6 +442,10 @@ void stroke_vertex()
if (is_dot) {
# ifdef GP_MATERIAL_BUFFER_LEN
int alignement = GP_FLAG(m) & GP_STROKE_ALIGNMENT;
/* For one point strokes use object aligment. */
if (ma.x == -1 && ma2.x == -1 && alignement == GP_STROKE_ALIGNMENT_STROKE) {
alignement = GP_STROKE_ALIGNMENT_OBJECT;
}
# endif
vec2 x_axis;