[Bf-blender-cvs] [de176b75b20] blender2.8: Fix T53764: vertical line glitch for collections with objects and collections

Dalai Felinto noreply at git.blender.org
Thu Jan 11 22:59:03 CET 2018


Commit: de176b75b2040cde2ff0e60932f6a0b0b880ed41
Author: Dalai Felinto
Date:   Thu Jan 11 17:17:17 2018 -0200
Branches: blender2.8
https://developer.blender.org/rBde176b75b2040cde2ff0e60932f6a0b0b880ed41

Fix T53764: vertical line glitch for collections with objects and collections

The code for vertical line was assuming that we necessarily neeeded vertical
lines for all the elements. Which is not true since we are not drawing
vertical and horizontal lines for collections.

Patch made in contribution with Philippe Schmid (@Quetzal).

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

M	source/blender/editors/space_outliner/outliner_draw.c

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index dd7a9f2880a..e2d60ef2f43 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1599,7 +1599,7 @@ static void outliner_draw_hierarchy_lines_recursive(unsigned pos, SpaceOops *soo
                                                     const unsigned char col[4], bool draw_grayed_out,
                                                     int *starty)
 {
-	TreeElement *te;
+	TreeElement *te, *te_vertical_line_last = NULL;
 	TreeStoreElem *tselem;
 	int y1, y2;
 
@@ -1609,10 +1609,10 @@ static void outliner_draw_hierarchy_lines_recursive(unsigned pos, SpaceOops *soo
 
 	const unsigned char grayed_alpha = col[3] / 2;
 
-	y1 = y2 = *starty; /* for vertical lines between objects */
+	/* For vertical lines between objects. */
+	y1 = *starty;
 	for (te = lb->first; te; te = te->next) {
 		bool draw_childs_grayed_out = draw_grayed_out || (te->drag_data != NULL);
-		y2 = *starty;
 		tselem = TREESTORE(te);
 
 		if (draw_childs_grayed_out) {
@@ -1622,10 +1622,17 @@ static void outliner_draw_hierarchy_lines_recursive(unsigned pos, SpaceOops *soo
 			immUniformColor4ubv(col);
 		}
 
-		/* horizontal line? */
-		if (tselem->type == 0 && (te->idcode == ID_OB || te->idcode == ID_SCE))
+		/* Horizontal Line? */
+		if (tselem->type == 0 && (te->idcode == ID_OB || te->idcode == ID_SCE)) {
 			immRecti(pos, startx, *starty, startx + UI_UNIT_X, *starty - 1);
-			
+
+			/* Vertical Line? */
+			if (te->idcode == ID_OB) {
+				te_vertical_line_last = te;
+				y2 = *starty;
+			}
+		}
+
 		*starty -= UI_UNIT_Y;
 		
 		if (TSELEM_OPEN(tselem, soops))
@@ -1640,12 +1647,10 @@ static void outliner_draw_hierarchy_lines_recursive(unsigned pos, SpaceOops *soo
 		immUniformColor4ubv(col);
 	}
 
-	/* vertical line */
-	te = lb->last;
-	if (te->parent || lb->first != lb->last) {
-		tselem = TREESTORE(te);
-		if (tselem->type == 0 && te->idcode == ID_OB)
-			immRecti(pos, startx, y1 + UI_UNIT_Y, startx + 1, y2);
+	/* Vertical line. */
+	te = te_vertical_line_last;
+	if ((te != NULL) && (te->parent || lb->first != lb->last)) {
+		immRecti(pos, startx, y1 + UI_UNIT_Y, startx + 1, y2);
 	}
 }



More information about the Bf-blender-cvs mailing list