Fix T76828 Grease Pencil: Toggle Caps doesn't work

This was a logic error.
This commit is contained in:
Clément Foucault 2020-05-18 15:51:19 +02:00
parent 19413c4a82
commit cb8d8335b2
Notes: blender-bot 2023-02-14 03:29:37 +01:00
Referenced by issue #77752, AMD Pro Driver crashes on ASAN build when switching to edit mode
Referenced by issue #76828, Grease Pencil: Toggle Caps doesn't work
1 changed files with 3 additions and 3 deletions

View File

@ -473,8 +473,8 @@ void stroke_vertex()
float miter_dot = dot(miter_tan, line_adj);
/* Break corners after a certain angle to avoid really thick corners. */
const float miter_limit = 0.5; /* cos(60°) */
bool miter_break = (miter_dot < miter_limit) || is_stroke_start || is_stroke_end;
miter_tan = (miter_break) ? line : (miter_tan / miter_dot);
bool miter_break = (miter_dot < miter_limit);
miter_tan = (miter_break || is_stroke_start || is_stroke_end) ? line : (miter_tan / miter_dot);
vec2 miter = rotate_90deg(miter_tan);
@ -487,7 +487,7 @@ void stroke_vertex()
/* Reminder: we packed the cap flag into the sign of stength and thickness sign. */
if ((is_stroke_start && strength1 > 0.0) || (is_stroke_end && thickness1 > 0.0) ||
miter_break) {
(miter_break && !is_stroke_start && !is_stroke_end)) {
screen_ofs += line * x;
}