[Bf-blender-cvs] [9c2bc5de4e5] greasepencil-object: GPencil: Cleanup function using SWAP macro

Antonio Vazquez noreply at git.blender.org
Sat Feb 15 16:22:53 CET 2020


Commit: 9c2bc5de4e567b774b655d24edcd9289118f6903
Author: Antonio Vazquez
Date:   Sat Feb 15 16:22:45 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB9c2bc5de4e567b774b655d24edcd9289118f6903

GPencil: Cleanup function using SWAP macro

===================================================================

M	source/blender/editors/gpencil/gpencil_utils.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 9245c55336e..a97a363dc12 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -2595,16 +2595,10 @@ bool ED_gpencil_stroke_check_collision(GP_SpaceConversion *gsc,
 
   /* Ensure the bounding box is oriented to axis. */
   if (boundbox_max[0] < boundbox_min[0]) {
-    float box;
-    box = boundbox_min[0];
-    boundbox_min[0] = boundbox_max[0];
-    boundbox_max[0] = box;
+    SWAP(float, boundbox_min[0], boundbox_max[0]);
   }
   if (boundbox_max[1] < boundbox_min[1]) {
-    float box;
-    box = boundbox_max[1];
-    boundbox_max[1] = boundbox_min[1];
-    boundbox_min[1] = box;
+    SWAP(float, boundbox_min[1], boundbox_max[1]);
   }
 
   rcti rect_stroke = {boundbox_min[0], boundbox_max[0], boundbox_min[1], boundbox_max[1]};



More information about the Bf-blender-cvs mailing list