Fix T93198: Frame Selected in greasepencil curve editing does not work

Was not taking into account curve points at all.

Maniphest Tasks: T93198

Differential Revision: https://developer.blender.org/D13281
This commit is contained in:
Philipp Oeser 2021-11-19 09:31:01 +01:00
parent f043b0334b
commit 9f73c9d656
Notes: blender-bot 2023-02-14 12:01:57 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #93198, Frame Selected does not work in Grease Pencil Curve Edit Mode
1 changed files with 17 additions and 0 deletions

View File

@ -3072,6 +3072,23 @@ static int viewselected_exec(bContext *C, wmOperator *op)
if ((gps->flag & GP_STROKE_SELECT) && (gps->flag & GP_STROKE_3DSPACE)) {
ok |= BKE_gpencil_stroke_minmax(gps, true, min, max);
}
if (gps->editcurve != NULL) {
for (int i = 0; i < gps->editcurve->tot_curve_points; i++) {
BezTriple *bezt = &gps->editcurve->curve_points[i].bezt;
if ((bezt->f1 & SELECT)) {
minmax_v3v3_v3(min, max, bezt->vec[0]);
ok = true;
}
if ((bezt->f2 & SELECT)) {
minmax_v3v3_v3(min, max, bezt->vec[1]);
ok = true;
}
if ((bezt->f3 & SELECT)) {
minmax_v3v3_v3(min, max, bezt->vec[2]);
ok = true;
}
}
}
}
CTX_DATA_END;