[Bf-blender-cvs] [363a196ed67] blender2.8: BBox accessor: switch to `switch`, add missing gpencil case.
Bastien Montagne
noreply at git.blender.org
Mon Oct 29 16:37:33 CET 2018
Commit: 363a196ed67572ef46bd76e0cc7afad2f130b561
Author: Bastien Montagne
Date: Mon Oct 29 12:06:27 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB363a196ed67572ef46bd76e0cc7afad2f130b561
BBox accessor: switch to `switch`, add missing gpencil case.
===================================================================
M source/blender/blenkernel/intern/object.c
===================================================================
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 745c907a9af..00031b2611c 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2497,20 +2497,29 @@ BoundBox *BKE_object_boundbox_get(Object *ob)
{
BoundBox *bb = NULL;
- if (ob->type == OB_MESH) {
- bb = BKE_mesh_boundbox_get(ob);
- }
- else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
- bb = BKE_curve_boundbox_get(ob);
- }
- else if (ob->type == OB_MBALL) {
- bb = BKE_mball_boundbox_get(ob);
- }
- else if (ob->type == OB_LATTICE) {
- bb = BKE_lattice_boundbox_get(ob);
- }
- else if (ob->type == OB_ARMATURE) {
- bb = BKE_armature_boundbox_get(ob);
+ switch (ob->type) {
+ case OB_MESH:
+ bb = BKE_mesh_boundbox_get(ob);
+ break;
+ case OB_CURVE:
+ case OB_SURF:
+ case OB_FONT:
+ bb = BKE_curve_boundbox_get(ob);
+ break;
+ case OB_MBALL:
+ bb = BKE_mball_boundbox_get(ob);
+ break;
+ case OB_LATTICE:
+ bb = BKE_lattice_boundbox_get(ob);
+ break;
+ case OB_ARMATURE:
+ bb = BKE_armature_boundbox_get(ob);
+ break;
+ case OB_GPENCIL:
+ bb = BKE_gpencil_boundbox_get(ob);
+ break;
+ default:
+ break;
}
return bb;
}
More information about the Bf-blender-cvs
mailing list