Fix T64463: Visual Artifacts with ColorRamp
authorHarley Acheson <harley.acheson@gmail.com>
Sun, 12 May 2019 22:21:43 +0000 (15:21 -0700)
committerHarley Acheson <harley.acheson@gmail.com>
Sun, 12 May 2019 22:21:43 +0000 (15:21 -0700)
This patch fixes an issue with the ColorRamp overflowing its drawing bounds

Differential Revision: https://developer.blender.org/D4843

Reviewed by Brecht Van Lommel

release/scripts/addons
release/scripts/addons_contrib
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_widgets.c

index fa8787a67ee6b34712896637edb0574973447a9b..20f59bfd2bc12cc67d045c11f47b6925e3b2a0a1 160000 (submodule)
@@ -1 +1 @@
-Subproject commit fa8787a67ee6b34712896637edb0574973447a9b
+Subproject commit 20f59bfd2bc12cc67d045c11f47b6925e3b2a0a1
index f72ec13e35dbd635c08ca331c8fac54086b0811d..2e2931867a5ccb455e16e0ccf19d77530fb5e69a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f72ec13e35dbd635c08ca331c8fac54086b0811d
+Subproject commit 2e2931867a5ccb455e16e0ccf19d77530fb5e69a
index 655c0b1775c54705af2b9e83cd181ad6decec108..640d512744695cbf1f4a4f10a76c574735e8e54d 100644 (file)
@@ -1599,8 +1599,8 @@ void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *UNUSED(wcol), const
     return;
   }
 
-  float x1 = rect->xmin + (0.25f * UI_UNIT_X);
-  float sizex = rect->xmax - x1 - (0.30f * UI_UNIT_X);
+  float x1 = rect->xmin;
+  float sizex = rect->xmax - x1;
   float sizey = BLI_rcti_size_y(rect);
   float sizey_solid = sizey * 0.25f;
   float y1 = rect->ymin;
index 5bcbc18fe270b1a651958aacfd38f1b10fd859a8..594793371ae97434010248b3f7ea11abc4767813 100644 (file)
@@ -4645,6 +4645,9 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
         break;
 
       case UI_BTYPE_COLORBAND:
+        /* do not draw right to edge of rect */
+        rect->xmin += (0.25f * UI_UNIT_X);
+        rect->xmax -= (0.3f * UI_UNIT_X);
         ui_draw_but_COLORBAND(but, &tui->wcol_regular, rect);
         break;