Fix missing line width for helper line drawing

Also scale by pixel size.
This commit is contained in:
Campbell Barton
2018-09-07 11:35:33 +10:00
parent 5940ea11ce
commit 77c0a7e1d5
3 changed files with 4 additions and 2 deletions

View 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);

View 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);

View 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];