[Bf-blender-cvs] [77c0a7e1d57] blender2.8: Fix missing line width for helper line drawing

Campbell Barton noreply at git.blender.org
Fri Sep 7 03:26:50 CEST 2018


Commit: 77c0a7e1d578f915ffbd4d127d0d5acb96a8a1d6
Author: Campbell Barton
Date:   Fri Sep 7 11:35:33 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB77c0a7e1d578f915ffbd4d127d0d5acb96a8a1d6

Fix missing line width for helper line drawing

Also scale by pixel size.

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

M	source/blender/editors/space_view3d/view3d_gizmo_ruler.c
M	source/blender/editors/space_view3d/view3d_ruler.c
M	source/blender/editors/util/ed_util.c

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

diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
index ec36f97ebd1..6bb6a022a82 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
@@ -520,7 +520,7 @@ static void gizmo_ruler_draw(const bContext *C, wmGizmo *gz)
 
 	/* anti-aliased lines for more consistent appearance */
 	GPU_line_smooth(true);
-	GPU_line_width(1.0f);
+	GPU_line_width(1.0f * U.pixelsize);
 
 	BLF_enable(blf_mono_font, BLF_ROTATION);
 	BLF_size(blf_mono_font, 14 * U.pixelsize, U.dpi);
diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c
index ea3896d1f30..d6637c2209e 100644
--- a/source/blender/editors/space_view3d/view3d_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_ruler.c
@@ -433,7 +433,7 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a
 
 	/* anti-aliased lines for more consistent appearance */
 	GPU_line_smooth(true);
-	GPU_line_width(1.0f);
+	GPU_line_width(1.0f * U.pixelsize);
 
 	BLF_enable(blf_mono_font, BLF_ROTATION);
 	BLF_size(blf_mono_font, 14 * U.pixelsize, U.dpi);
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 35a77fcd4c0..6c4f963b011 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -344,6 +344,8 @@ void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *ar, void *arg_info
 
 	const uint shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
 
+	GPU_line_width(1.0f * U.pixelsize);
+
 	immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
 
 	float viewport_size[4];



More information about the Bf-blender-cvs mailing list