Fix missing line width for helper line drawing
authorCampbell Barton <ideasman42@gmail.com>
Fri, 7 Sep 2018 01:35:33 +0000 (11:35 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 7 Sep 2018 01:35:33 +0000 (11:35 +1000)
Also scale by pixel size.

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

index ec36f97ebd1a1c0c1e35c16ca73eb975b8d50d14..6bb6a022a823bc046ccdf14b2dea61eafb07c8e5 100644 (file)
@@ -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);
index ea3896d1f308bd08d91beca312d6af56c8407f90..d6637c2209e65d9159c41b0b5abbd4491feaa271 100644 (file)
@@ -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);
index 35a77fcd4c03de9ad7677fc31c32353ef6b99482..6c4f963b0115a5872bc26d692015061b13966738 100644 (file)
@@ -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];