[Bf-blender-cvs] [c4f69794ca1] blender2.8: UI: Fix point size and line width ignoring UI scaling option
Clément Foucault
noreply at git.blender.org
Tue Oct 30 16:44:33 CET 2018
Commit: c4f69794ca14e3c38ea8558c8a5414df2a778e19
Author: Clément Foucault
Date: Tue Oct 30 16:21:44 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBc4f69794ca14e3c38ea8558c8a5414df2a778e19
UI: Fix point size and line width ignoring UI scaling option
===================================================================
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
M source/blender/gpu/intern/gpu_state.c
===================================================================
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
index a3bd1b26a01..06dcafbe614 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
@@ -519,7 +519,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 * U.pixelsize);
+ GPU_line_width(1.0f);
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 ae57700653a..1250e97c26f 100644
--- a/source/blender/editors/space_view3d/view3d_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_ruler.c
@@ -432,7 +432,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 * U.pixelsize);
+ GPU_line_width(1.0f);
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 10698b9ebab..d340938495d 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -347,7 +347,7 @@ 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);
+ GPU_line_width(1.0f);
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
diff --git a/source/blender/gpu/intern/gpu_state.c b/source/blender/gpu/intern/gpu_state.c
index 68d846ccfba..803c595aaf3 100644
--- a/source/blender/gpu/intern/gpu_state.c
+++ b/source/blender/gpu/intern/gpu_state.c
@@ -25,6 +25,8 @@
*
*/
+#include "DNA_userdef_types.h"
+
#include "GPU_glew.h"
#include "GPU_state.h"
@@ -110,12 +112,12 @@ void GPU_line_stipple(bool enable)
void GPU_line_width(float width)
{
- glLineWidth(width);
+ glLineWidth(width * U.pixelsize);
}
void GPU_point_size(float size)
{
- glPointSize(size);
+ glPointSize(size * U.pixelsize);
}
void GPU_polygon_smooth(bool enable)
More information about the Bf-blender-cvs
mailing list