Commit: 09ee3eb173b3889d4f5309e450df290a8c0bbe76
Author: Campbell Barton
Date:   Mon Apr 9 12:44:25 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB09ee3eb173b3889d4f5309e450df290a8c0bbe76

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/editors/transform/transform.c
index a4bce5b0f1d,90014667b43..3aeb38970d2
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@@ -1706,57 -1693,16 +1706,47 @@@ static void drawHelpline(bContext *UNUS
  {
        TransInfo *t = (TransInfo *)customdata;
  
 -      if (t->helpline != HLP_NONE && !(t->flag & T_USES_MANIPULATOR)) {
 +      if (t->helpline != HLP_NONE) {
-               float vecrot[3], cent[2];
+               float cent[2];
 -              int mval[2];
 -
 -              mval[0] = x;
 -              mval[1] = y;
 +              float mval[3] = { x, y, 0.0f };
  
-               copy_v3_v3(vecrot, t->center);
-               if (t->flag & T_EDIT) {
-                       Object *ob = t->obedit;
-                       if (ob) mul_m4_v3(ob->obmat, vecrot);
-               }
-               else if (t->flag & T_POSE) {
-                       Object *ob = t->poseobj;
-                       if (ob) mul_m4_v3(ob->obmat, vecrot);
-               }
- 
-               projectFloatViewEx(t, vecrot, cent, V3D_PROJ_TEST_CLIP_ZERO);
+               projectFloatViewEx(t, t->center_global, cent, 
V3D_PROJ_TEST_CLIP_ZERO);
  
 -              glPushMatrix();
 +              gpuPushMatrix();
 +
 +              /* Dashed lines first. */
 +              if (ELEM(t->helpline, HLP_SPRING, HLP_ANGLE)) {
 +                      const uint shdr_pos = 
GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, 
GWN_FETCH_FLOAT);
 +
 +                      UNUSED_VARS_NDEBUG(shdr_pos); /* silence warning */
 +                      BLI_assert(shdr_pos == POS_INDEX);
 +
 +                      glLineWidth(1.0f);
 +
 +                      
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
 +
 +                      float viewport_size[4];
 +                      glGetFloatv(GL_VIEWPORT, viewport_size);
 +                      immUniform2f("viewport_size", viewport_size[2], 
viewport_size[3]);
 +
 +                      immUniform1i("num_colors", 0);  /* "simple" mode */
 +                      immUniformThemeColor(TH_VIEW_OVERLAY);
 +                      immUniform1f("dash_width", 6.0f);
 +                      immUniform1f("dash_factor", 0.5f);
 +
 +                      immBegin(GWN_PRIM_LINES, 2);
 +                      immVertex2fv(POS_INDEX, cent);
 +                      immVertex2f(POS_INDEX, (float)t->mval[0], 
(float)t->mval[1]);
 +                      immEnd();
 +
 +                      immUnbindProgram();
 +              }
 +
 +              /* And now, solid lines. */
 +              unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), 
"pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 +              UNUSED_VARS_NDEBUG(pos); /* silence warning */
 +              BLI_assert(pos == POS_INDEX);
 +              immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
  
                switch (t->helpline) {
                        case HLP_SPRING:

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to