[Bf-blender-cvs] [2fcdebcc4e8] greasepencil-edit-curve: Merge branch 'master' into greasepencil-edit-curve

Antonio Vazquez noreply at git.blender.org
Mon Jun 29 20:18:30 CEST 2020


Commit: 2fcdebcc4e8b5793826e9ff725750042bee5ceba
Author: Antonio Vazquez
Date:   Mon Jun 29 15:53:45 2020 +0200
Branches: greasepencil-edit-curve
https://developer.blender.org/rB2fcdebcc4e8b5793826e9ff725750042bee5ceba

Merge branch 'master' into greasepencil-edit-curve

 Conflicts:
	source/blender/editors/gpencil/gpencil_select.c

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



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

diff --cc source/blender/editors/gpencil/gpencil_select.c
index 03501e948a5,ea6f53d24bb..e207c3f293b
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@@ -1648,42 -1416,38 +1648,42 @@@ static int gpencil_select_exec(bContex
      whole = (bool)(ts->gpencil_selectmode_edit == GP_SELECTMODE_STROKE);
    }
  
 -  /* init space conversion stuff */
 -  gpencil_point_conversion_init(C, &gsc);
 +  if (is_curve_edit) {
 +    gpencil_select_curve_point(
 +        C, mval, radius_squared, &hit_curve, &hit_curve_point, &hit_curve_handle);
 +  }
  
 -  /* get mouse location */
 -  RNA_int_get_array(op->ptr, "location", mval);
 +  if (hit_curve_point == NULL) {
 +    /* init space conversion stuff */
-     gp_point_conversion_init(C, &gsc);
++    gpencil_point_conversion_init(C, &gsc);
  
 -  /* First Pass: Find stroke point which gets hit */
 -  GP_EVALUATED_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
 -    bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig : gps;
 -    bGPDspoint *pt;
 -    int i;
 +    /* First Pass: Find stroke point which gets hit */
 +    GP_EVALUATED_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
 +      bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig : gps;
 +      bGPDspoint *pt;
 +      int i;
  
--    /* firstly, check for hit-point */
--    for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
--      int xy[2];
 -
 -      bGPDspoint pt2;
 -      gpencil_point_to_parent_space(pt, gpstroke_iter.diff_mat, &pt2);
 -      gpencil_point_to_xy(&gsc, gps, &pt2, &xy[0], &xy[1]);
 -
 -      /* do boundbox check first */
 -      if (!ELEM(V2D_IS_CLIPPED, xy[0], xy[1])) {
 -        const int pt_distance = len_manhattan_v2v2_int(mval, xy);
 -
 -        /* check if point is inside */
 -        if (pt_distance <= radius_squared) {
 -          /* only use this point if it is a better match than the current hit - T44685 */
 -          if (pt_distance < hit_distance) {
 -            hit_layer = gpl;
 -            hit_stroke = gps_active;
 -            hit_point = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
 -            hit_distance = pt_distance;
++      /* firstly, check for hit-point */
++      for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
++        int xy[2];
 +
 +        bGPDspoint pt2;
-         gp_point_to_parent_space(pt, gpstroke_iter.diff_mat, &pt2);
-         gp_point_to_xy(&gsc, gps, &pt2, &xy[0], &xy[1]);
++        gpencil_point_to_parent_space(pt, gpstroke_iter.diff_mat, &pt2);
++        gpencil_point_to_xy(&gsc, gps, &pt2, &xy[0], &xy[1]);
 +
 +        /* do boundbox check first */
 +        if (!ELEM(V2D_IS_CLIPPED, xy[0], xy[1])) {
 +          const int pt_distance = len_manhattan_v2v2_int(mval, xy);
 +
 +          /* check if point is inside */
 +          if (pt_distance <= radius_squared) {
 +            /* only use this point if it is a better match than the current hit - T44685 */
 +            if (pt_distance < hit_distance) {
 +              hit_layer = gpl;
 +              hit_stroke = gps_active;
 +              hit_point = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
 +              hit_distance = pt_distance;
 +            }
            }
          }
        }



More information about the Bf-blender-cvs mailing list