Przeglądaj źródła

Improve one poor case of indentation

The original code was distinctly unclear. I've tried to keep to the
surrounding code style while making the code flow more comprehensible.

I've not looked elsewhere for any other similar occurrences; this became
apparent while investigating a specific line of thought.
bolt 1 rok temu
rodzic
commit
a689b8efdf
2 zmienionych plików z 18 dodań i 14 usunięć
  1. 9 7
      nuklear.h
  2. 9 7
      src/nuklear_vertex.c

+ 9 - 7
nuklear.h

@@ -9694,14 +9694,16 @@ nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture)
         struct nk_draw_command *prev = nk_draw_list_command_last(list);
         if (prev->elem_count == 0) {
             prev->texture = texture;
-        #ifdef NK_INCLUDE_COMMAND_USERDATA
+            #ifdef NK_INCLUDE_COMMAND_USERDATA
             prev->userdata = list->userdata;
-        #endif
-    } else if (prev->texture.id != texture.id
-        #ifdef NK_INCLUDE_COMMAND_USERDATA
-            || prev->userdata.id != list->userdata.id
-        #endif
-        ) nk_draw_list_push_command(list, prev->clip_rect, texture);
+            #endif
+        } else if (prev->texture.id != texture.id
+                #ifdef NK_INCLUDE_COMMAND_USERDATA
+                || prev->userdata.id != list->userdata.id
+                #endif
+                ) {
+            nk_draw_list_push_command(list, prev->clip_rect, texture);
+        }
     }
 }
 #ifdef NK_INCLUDE_COMMAND_USERDATA

+ 9 - 7
src/nuklear_vertex.c

@@ -196,14 +196,16 @@ nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture)
         struct nk_draw_command *prev = nk_draw_list_command_last(list);
         if (prev->elem_count == 0) {
             prev->texture = texture;
-        #ifdef NK_INCLUDE_COMMAND_USERDATA
+            #ifdef NK_INCLUDE_COMMAND_USERDATA
             prev->userdata = list->userdata;
-        #endif
-    } else if (prev->texture.id != texture.id
-        #ifdef NK_INCLUDE_COMMAND_USERDATA
-            || prev->userdata.id != list->userdata.id
-        #endif
-        ) nk_draw_list_push_command(list, prev->clip_rect, texture);
+            #endif
+        } else if (prev->texture.id != texture.id
+                #ifdef NK_INCLUDE_COMMAND_USERDATA
+                || prev->userdata.id != list->userdata.id
+                #endif
+                ) {
+            nk_draw_list_push_command(list, prev->clip_rect, texture);
+        }
     }
 }
 #ifdef NK_INCLUDE_COMMAND_USERDATA