@@ -2819,35 +2819,38 @@ void MCCard::updateselection(MCControl *cptr, const MCRectangle &oldrect,
28192819 if (!cptr -> isselectable ()
28202820 && (!MCselectgrouped || cptr->gettype () != CT_GROUP))
28212821 return ;
2822- MCGroup *gptr = MCObjectCast<MCGroup>(cptr);
28232822
28242823 // MW-2008-12-04: [[ Bug ]] Make sure we honour group-local selectGrouped for
28252824 // select-tool drags
2826- if (MCselectgrouped && cptr->gettype () == CT_GROUP
2827- && gptr->getcontrols () != NULL && gptr->getflag (F_VISIBLE) && !gptr->getflag (F_SELECT_GROUP))
2828- {
2829- cptr = gptr->getcontrols ();
2830-
2831- MCRectangle t_group_rect;
2832- t_group_rect = gptr -> getrect ();
2833-
2834- MCRectangle t_group_oldrect;
2835- t_group_oldrect = MCU_intersect_rect (oldrect, t_group_rect);
2836-
2837- MCRectangle t_group_selrect;
2838- t_group_selrect = MCU_intersect_rect (p_selrect, t_group_rect);
2839-
2840- do
2825+ if (MCselectgrouped && cptr->gettype () == CT_GROUP)
2826+ {
2827+ MCGroup *gptr = MCObjectCast<MCGroup>(cptr);
2828+ if (gptr->getcontrols () != NULL && gptr->getflag (F_VISIBLE) && !gptr->getflag (F_SELECT_GROUP))
28412829 {
2842- MCRectangle t_rect;
2843- t_rect = cptr -> getrect ();
2844- if (MCU_line_intersect_rect (t_group_rect, t_rect))
2845- updateselection (cptr, t_group_oldrect, t_group_selrect, drect);
2830+ cptr = gptr->getcontrols ();
28462831
2847- cptr = cptr->next ();
2832+
2833+ MCRectangle t_group_rect;
2834+ t_group_rect = gptr -> getrect ();
2835+
2836+ MCRectangle t_group_oldrect;
2837+ t_group_oldrect = MCU_intersect_rect (oldrect, t_group_rect);
2838+
2839+ MCRectangle t_group_selrect;
2840+ t_group_selrect = MCU_intersect_rect (selrect, t_group_rect);
2841+
2842+ do
2843+ {
2844+ MCRectangle t_rect;
2845+ t_rect = cptr -> getrect ();
2846+ if (MCU_line_intersect_rect (t_group_rect, t_rect))
2847+ updateselection (cptr, t_group_oldrect, t_group_selrect, drect);
2848+
2849+ cptr = cptr->next ();
2850+ }
2851+ while (cptr != gptr->getcontrols ());
28482852 }
2849- while (cptr != gptr->getcontrols ());
2850- }
2853+ }
28512854 else
28522855 {
28532856 Boolean was, is;
0 commit comments