title: Custom component redraw issue with Delphi
body: <p>I have written a new custom component derived from TLabel. The component adds some custom drawing to component, but nothing else. When component is painted, everything works fine. But when the redraw is needed (like dragging another window over the component), "label part" works fine but my custom drawing is not properly updated. I'm basically drawing directly to the canvas in an overridden Paint method, and when the redraw is required the parts of canvas where my code has drawn something is painted black. It seems like that the paint method is not called. What I should do to get proper redraw?</p>
  
  <p>The component is basically:</p>
  
  <pre><code>TMyComponent = class(TCustomLabel, IMyInterface)
  ..
  protected
    procedure Paint; override;
  ..
  
  procedure TMyComponent.Paint;
  begin
    inherited;
    MyCustomPaint;
  end;
  </code></pre>
  
  <p>Update, the paint routine:</p>
  
  <pre><code>Position := Point(0,0);
  Radius := 15;
  FillColor := clBlue;
  BorderColor := clBlack;
  Canvas.Pen.Color := BorderColor;
  Canvas.Pen.Width := 1;
  Canvas.Brush.Color := BorderColor;
  Canvas.Ellipse(Position.X, Position.Y, Position.X + Radius,  Position.Y + Radius);
  Canvas.Brush.Color := FillColor;
  Canvas.FloodFill(Position.X + Radius div 2,
    Position.Y + Radius div 2, BorderColor, fsSurface);
  </code></pre>
  
  <p>SOLVED:</p>
  
  <p>The problem is (redundant) use of FloodFill. If the Canvas is not fully visible floodfill causes artifacts. I removed the floodfill and now it works as needed.</p>