Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-10-29 14:06:27 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-10-29 18:37:27 +0300
commit363a196ed67572ef46bd76e0cc7afad2f130b561 (patch)
treee747a9f685ec2ac66d31dc68cd95176c840c6fa3 /source/blender/blenkernel/intern/object.c
parent8ee575867ac2044ba164fb91573d158cda508261 (diff)
BBox accessor: switch to `switch`, add missing gpencil case.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c37
1 files changed, 23 insertions, 14 deletions
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;
}