Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-06-21 01:24:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-06-21 01:29:08 +0300
commit2cad07176178b5acc20091416dd80d4791950062 (patch)
treef77e126b658760c15fcd122f9e4fae3ea73607d8 /source/blender/windowmanager/intern/wm_gesture.c
parentb30f3f6c19c9a791c8899d97d376df08baa3889e (diff)
Fix dashed line drawing
The dash_factor wasn't being set in many places, having the graph editor open for eg, caused box-select in the 3D view not to show dashes.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_gesture.c')
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index 11f9ef917fd..b79de4370d0 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -215,6 +215,7 @@ static void wm_gesture_draw_line(wmGesture *gt)
immUniformArray4fv(
"colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
immUniform1f("dash_width", 8.0f);
+ immUniform1f("dash_factor", 0.5f);
float xmin = (float)rect->xmin;
float ymin = (float)rect->ymin;
@@ -257,6 +258,7 @@ static void wm_gesture_draw_rect(wmGesture *gt)
immUniformArray4fv(
"colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
immUniform1f("dash_width", 8.0f);
+ immUniform1f("dash_factor", 0.5f);
imm_draw_box_wire_2d(
shdr_pos, (float)rect->xmin, (float)rect->ymin, (float)rect->xmax, (float)rect->ymax);
@@ -295,6 +297,7 @@ static void wm_gesture_draw_circle(wmGesture *gt)
immUniformArray4fv(
"colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
immUniform1f("dash_width", 4.0f);
+ immUniform1f("dash_factor", 0.5f);
imm_draw_circle_wire_2d(shdr_pos, (float)rect->xmin, (float)rect->ymin, (float)rect->xmax, 40);
@@ -418,6 +421,7 @@ static void wm_gesture_draw_lasso(wmGesture *gt, bool filled)
immUniformArray4fv(
"colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
immUniform1f("dash_width", 2.0f);
+ immUniform1f("dash_factor", 0.5f);
immBegin((gt->type == WM_GESTURE_LASSO) ? GPU_PRIM_LINE_LOOP : GPU_PRIM_LINE_STRIP, numverts);
@@ -451,6 +455,7 @@ static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
immUniformArray4fv(
"colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2);
immUniform1f("dash_width", 8.0f);
+ immUniform1f("dash_factor", 0.5f);
immBegin(GPU_PRIM_LINES, 4);