@@ -433,6 +433,8 @@ void MCControl::select()
433433
434434 // MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
435435 layer_redrawall ();
436+
437+ getcard ()->dirtyselection (rect);
436438}
437439
438440void MCControl::deselect ()
@@ -446,6 +448,8 @@ void MCControl::deselect()
446448 // MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
447449 layer_redrawall ();
448450
451+ getcard ()->dirtyselection (rect);
452+
449453 state &= ~(CS_SELECTED | CS_MOVE | CS_SIZE | CS_CREATE );
450454 }
451455}
@@ -790,30 +794,30 @@ void MCControl::redraw(MCDC *dc, const MCRectangle &dirty)
790794 }
791795}
792796
793- void MCControl::sizerects (MCRectangle *rects )
797+ void MCControl::sizerects (const MCRectangle &p_object_rect, MCRectangle r_rects[ 8 ] )
794798{
795799 int2 x[3 ];
796800 int2 y[3 ];
797801
798802 uint2 handlesize = MCsizewidth;
799-
800- x[0 ] = rect.x - (handlesize >> 1 );
801- x[1 ] = rect.x + ((rect.width - handlesize) >> 1 );
802- x[2 ] = rect.x + rect.width - (handlesize >> 1 );
803- y[0 ] = rect.y - (handlesize >> 1 );
804- y[1 ] = rect.y + ((rect.height - handlesize) >> 1 );
805- y[2 ] = rect.y + rect.height - (handlesize >> 1 );
806803
804+ x[0 ] = p_object_rect.x - (handlesize >> 1 );
805+ x[1 ] = p_object_rect.x + ((p_object_rect.width - handlesize) >> 1 );
806+ x[2 ] = p_object_rect.x + p_object_rect.width - (handlesize >> 1 );
807+ y[0 ] = p_object_rect.y - (handlesize >> 1 );
808+ y[1 ] = p_object_rect.y + ((p_object_rect.height - handlesize) >> 1 );
809+ y[2 ] = p_object_rect.y + p_object_rect.height - (handlesize >> 1 );
810+
807811 uint2 i;
808812 uint2 j;
809813 uint2 k = 0 ;
810814 for (i = 0 ; i < 3 ; i++)
811815 for (j = 0 ; j < 3 ; j++)
812816 if (i != 1 || j != 1 )
813817 {
814- rects [k].width = rects [k].height = handlesize;
815- rects [k].x = x[j];
816- rects [k].y = y[i];
818+ r_rects [k].width = r_rects [k].height = handlesize;
819+ r_rects [k].x = x[j];
820+ r_rects [k].y = y[i];
817821 k++;
818822 }
819823}
@@ -833,7 +837,7 @@ void MCControl::drawselected(MCDC *dc)
833837 drawmarquee (dc, rect);
834838
835839 MCRectangle rects[8 ];
836- sizerects (rects);
840+ sizerects (rect, rects);
837841 if (flags & F_LOCK_LOCATION )
838842 dc->setfillstyle (FillStippled, nil, 0 , 0 );
839843 else
@@ -1173,7 +1177,7 @@ uint2 MCControl::sizehandles(int2 px, int2 py)
11731177 if (!(flags & F_LOCK_LOCATION ))
11741178 {
11751179 MCRectangle rects[8 ];
1176- sizerects (rects);
1180+ sizerects (rect, rects);
11771181 int2 i;
11781182 for (i = 7 ; i >= 0 ; i--)
11791183 {
@@ -1719,9 +1723,6 @@ MCRectangle MCControl::geteffectiverect(void) const
17191723 MCRectangle t_rect;
17201724 t_rect = MCU_reduce_rect (rect, -gettransient ());
17211725
1722- if (state & CS_SELECTED )
1723- t_rect = MCU_reduce_rect (t_rect, -MCsizewidth);
1724-
17251726 if (m_bitmap_effects != nil)
17261727 MCBitmapEffectsComputeBounds (m_bitmap_effects, t_rect, t_rect);
17271728
0 commit comments