Fix T62743: GPencil dimensions are large when no geometry exists

Use fallback when no data exists
matching bound-box for other kinds of geometry.
This commit is contained in:
Campbell Barton
2019-03-19 23:49:56 +11:00
parent 0aca8b0174
commit c001a9c3b6

View File

@@ -1118,7 +1118,11 @@ static void boundbox_gpencil(Object *ob)
bb = ob->runtime.bb;
gpd = ob->data;
BKE_gpencil_data_minmax(NULL, gpd, min, max);
if (!BKE_gpencil_data_minmax(NULL, gpd, min, max)) {
min[0] = min[1] = min[2] = -1.0f;
max[0] = max[1] = max[2] = 1.0f;
}
BKE_boundbox_init_from_minmax(bb, min, max);
bb->flag &= ~BOUNDBOX_DIRTY;