[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: o_find.nw



  User: cnieves 
  Date: 06/05/20 14:51:46

  Modified:    .        o_find.nw x_event.nw
  Log:
  Fixed issue with the selection box when some components overlap.
  
  
  
  
  Revision  Changes    Path
  1.10      +44 -0     eda/geda/devel/gschem/noweb/o_find.nw
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_find.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/o_find.nw,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- o_find.nw	17 May 2006 14:20:49 -0000	1.9
  +++ o_find.nw	20 May 2006 18:51:45 -0000	1.10
  @@ -12,6 +12,7 @@
   
   <<o_find.c : include directives>>
   <<o_find.c : o_find_object()>>
  +<<o_find.c : o_find_selected_object()>>
   
   @
   
  @@ -158,3 +159,46 @@
   @ %def o_find_object
   
   
  +@section Function @code{o_find_selected_object()}
  +
  +@defun o_find_selected_object w_current screen_x screen_y
  +@end defun
  +
  +<<o_find.c : o_find_selected_object()>>=
  +gboolean
  +o_find_selected_object(TOPLEVEL *w_current, int screen_x, int screen_y)
  +{
  +  OBJECT *o_current=NULL;
  +  SELECTION *s_current;
  +
  +  g_assert (w_current->page_current->selection2_head != NULL);
  +
  +  /* Skip the head node */
  +  s_current = w_current->page_current->selection2_head->next;
  +  /* do first search */
  +  while (s_current != NULL) {
  +    o_current = s_current->selected_object;
  +    if (inside_region(o_current->left, o_current->top,
  +                      o_current->right, o_current->bottom, 
  +                      screen_x, screen_y)) {
  +      printf("o_find_selected_object:\n");
  +      printf("Object bounds:\n\tL: %i\tR: %i\n\tT: %i\tB: %i.\n",
  +	     o_current->left, o_current->right, o_current->top, o_current->bottom);
  +      printf("Screen pointer at: (%i,%i)\n", screen_x, screen_y);
  +      if (o_current->sel_func != NULL &&
  +	  o_current->type != OBJ_HEAD &&
  +	  (o_current->visibility == VISIBLE ||
  +	   (o_current->visibility == INVISIBLE &&
  +	    w_current->show_hidden_text))) {
  +	return TRUE;
  +      }
  +    }
  +    
  +    s_current = s_current->next;
  +  } 
  +
  +  return (FALSE);
  +}
  +
  +
  +@ %def o_find_selected_object
  
  
  
  1.25      +2 -2      eda/geda/devel/gschem/noweb/x_event.nw
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_event.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/x_event.nw,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -b -r1.24 -r1.25
  --- x_event.nw	17 May 2006 14:20:49 -0000	1.24
  +++ x_event.nw	20 May 2006 18:51:45 -0000	1.25
  @@ -1074,8 +1074,8 @@
       case(STARTSELECT):
       if ( (!w_current->drag_can_move) ||
   	 (w_current->drag_can_move && 
  -	  (! o_find_object(w_current, 
  -			   w_current->start_x, w_current->start_y, FALSE)))) {
  +	  (! o_find_selected_object(w_current, 
  +				    w_current->start_x, w_current->start_y)))) {
         temp_x = fix_x(w_current, (int) event->x);
         temp_y = fix_y(w_current, (int) event->y);
         /* is eight enough of a threshold? */