[Bf-blender-cvs] [80afab3d82a] temp-udim-images: Allocate correct length for drawing UDIM grids

Lukas Stockner noreply at git.blender.org
Mon Jul 23 02:51:30 CEST 2018


Commit: 80afab3d82a358b75ffe6549047975ea3acdf471
Author: Lukas Stockner
Date:   Mon Jul 23 02:46:35 2018 +0200
Branches: temp-udim-images
https://developer.blender.org/rB80afab3d82a358b75ffe6549047975ea3acdf471

Allocate correct length for drawing UDIM grids

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

M	source/blender/editors/space_image/image_draw.c

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

diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index d69c4bcd88c..aa0977f835f 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -692,8 +692,13 @@ static void draw_image_tiles(ARegion *ar, SpaceImage *sima, Image *ima)
 	unsigned int pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
 	unsigned color = GPU_vertformat_attr_add(format, "color", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
 
+	int num_grids = num_tiles;
+	if (num_tiles > 1) {
+		num_grids++;
+	}
+
 	immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
-	immBegin(GPU_PRIM_LINES, 8*num_tiles);
+	immBegin(GPU_PRIM_LINES, 8*num_grids);
 
 	float theme_color[3], selected_color[3];
 	UI_GetThemeColorShade3fv(TH_BACK, 60.0f, theme_color);



More information about the Bf-blender-cvs mailing list