[Bf-blender-cvs] [3d55d80c59d] master: Masking: Cleanup, indentation level

Sergey Sharybin noreply at git.blender.org
Mon Nov 4 14:06:26 CET 2019


Commit: 3d55d80c59d97ce12d1e5f344e7f1aaf1c9c2a4f
Author: Sergey Sharybin
Date:   Thu Oct 31 15:58:19 2019 +0100
Branches: master
https://developer.blender.org/rB3d55d80c59d97ce12d1e5f344e7f1aaf1c9c2a4f

Masking: Cleanup, indentation level

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

M	source/blender/editors/mask/mask_draw.c

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

diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index 4e75d49987e..bcca7f8b35f 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -799,36 +799,38 @@ void ED_mask_draw_frames(Mask *mask, ARegion *ar, const int cfra, const int sfra
   const float framelen = ar->winx / (float)(efra - sfra + 1);
 
   MaskLayer *mask_layer = BKE_mask_layer_active(mask);
+  if (mask_layer == NULL) {
+    return;
+  }
 
-  if (mask_layer) {
-    unsigned int num_lines = BLI_listbase_count(&mask_layer->splines_shapes);
+  unsigned int num_lines = BLI_listbase_count(&mask_layer->splines_shapes);
+  if (num_lines == 0) {
+    return;
+  }
 
-    if (num_lines > 0) {
-      /* Local coordinate visible rect inside region, to accommodate overlapping ui. */
-      const rcti *rect_visible = ED_region_visible_rect(ar);
-      const int region_bottom = rect_visible->ymin;
+  /* Local coordinate visible rect inside region, to accommodate overlapping ui. */
+  const rcti *rect_visible = ED_region_visible_rect(ar);
+  const int region_bottom = rect_visible->ymin;
 
-      uint pos = GPU_vertformat_attr_add(
-          immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
+  uint pos = GPU_vertformat_attr_add(
+      immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
 
-      immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
-      immUniformColor4ub(255, 175, 0, 255);
+  immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+  immUniformColor4ub(255, 175, 0, 255);
 
-      immBegin(GPU_PRIM_LINES, 2 * num_lines);
+  immBegin(GPU_PRIM_LINES, 2 * num_lines);
 
-      for (MaskLayerShape *mask_layer_shape = mask_layer->splines_shapes.first;
-           mask_layer_shape != NULL;
-           mask_layer_shape = mask_layer_shape->next) {
-        int frame = mask_layer_shape->frame;
+  for (MaskLayerShape *mask_layer_shape = mask_layer->splines_shapes.first;
+       mask_layer_shape != NULL;
+       mask_layer_shape = mask_layer_shape->next) {
+    int frame = mask_layer_shape->frame;
 
-        /* draw_keyframe(i, CFRA, sfra, framelen, 1); */
-        int height = (frame == cfra) ? 22 : 10;
-        int x = (frame - sfra) * framelen;
-        immVertex2i(pos, x, region_bottom);
-        immVertex2i(pos, x, region_bottom + height * UI_DPI_FAC);
-      }
-      immEnd();
-      immUnbindProgram();
-    }
+    /* draw_keyframe(i, CFRA, sfra, framelen, 1); */
+    int height = (frame == cfra) ? 22 : 10;
+    int x = (frame - sfra) * framelen;
+    immVertex2i(pos, x, region_bottom);
+    immVertex2i(pos, x, region_bottom + height * UI_DPI_FAC);
   }
+  immEnd();
+  immUnbindProgram();
 }



More information about the Bf-blender-cvs mailing list