void TCanvasRectDragInteractor::DrawFeedback () { unsigned long n = GetNumberOfPoints (); if ( n > 0 ) { MToolHandler* toolHandler = GetToolHandler (); MGraphic* oldFeedbackGraphic = toolHandler->OrphanFeedbackGraphic (true); TGrafBundle* bundle = NIL; if ( oldFeedbackGraphic ) bundle = oldFeedbackGraphic->OrphanBundle (); else bundle = new TGrafBundle(new TColorPaint(TRGBColor(0.,0.,0.)), TAttributeState::kFrame); delete oldFeedbackGraphic; TGRect r (GetFirstPoint(),GetLastPoint()); r.OrderPoints (); TPolygon* newFeedbackGraphic = new TPolygon (r, bundle); TGRect bounds = newFeedbackGraphic->GetLooseFitBounds (); bounds.Inset (TGPoint(-1.,-1.)); TGArea totalArea (bounds); toolHandler->AdoptFeedbackGraphic (newFeedbackGraphic, totalArea, totalArea); } }