Commit: a63be6c6c729a0047bb5cfeda2eca570053eac08
Author: Dalai Felinto
Date:   Tue May 14 20:03:44 2019 -0300
Branches: master
https://developer.blender.org/rBa63be6c6c729a0047bb5cfeda2eca570053eac08

Fix T64467: Outliner Rename drawing overlapping restriction column + checkbox

For anyone interesting on polishing pixels, this is still one of the few
places in Blender where when renaming the name "jumps" a tiny bit when
editing. Most of the other places (id rename, UI list rename, ...) have
the text drawing in the exact same place while editing it and drawing.

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

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 7e401b894de..6547b46a6e6 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1642,8 +1642,13 @@ static void outliner_draw_rnabuts(
   }
 }
 
-static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, 
TreeElement *te)
+static void outliner_buttons(const bContext *C,
+                             uiBlock *block,
+                             ARegion *ar,
+                             const float restrict_column_width,
+                             TreeElement *te)
 {
+  SpaceOutliner *soops = CTX_wm_space_outliner(C);
   uiBut *bt;
   TreeStoreElem *tselem;
   int spx, dx, len;
@@ -1669,7 +1674,11 @@ static void outliner_buttons(const bContext *C, uiBlock 
*block, ARegion *ar, Tre
   }
 
   spx = te->xs + 1.8f * UI_UNIT_X;
-  dx = ar->v2d.cur.xmax - (spx + 3.2f * UI_UNIT_X);
+  if ((tselem->type == TSE_LAYER_COLLECTION) &&
+      (soops->show_restrict_flags & SO_RESTRICT_ENABLE)) {
+    spx += UI_UNIT_X;
+  }
+  dx = ar->v2d.cur.xmax - (spx + restrict_column_width + 0.2f * UI_UNIT_X);
 
   bt = uiDefBut(block,
                 UI_BTYPE_TEXT,
@@ -3305,7 +3314,7 @@ void draw_outliner(const bContext *C)
 
   /* Draw edit buttons if necessary. */
   if (te_edit) {
-    outliner_buttons(C, block, ar, te_edit);
+    outliner_buttons(C, block, ar, restrict_column_width, te_edit);
   }
 
   UI_block_end(C, block);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to