Paint method and clip rectangle question

Hi

I have a control that does its own painiting. In its paint method, it calls fillRect() passing the whole control's size. My understanding is that the Java GUI sub system will make sure it doesn't fill anything outside the graphics context's clip rectangle.

Is it a valid assumption?

Is it the programmer's responsibility to look at current clip rectangle size and call fillRect() with params that point to the intersection of control's bounding rectangle and clip rectangle?

puri

[518 byte] By [puri_mallurua] at [2007-11-27 5:25:32]
# 1
Drop something like this into your painting method body and see what it is going to render.System.out.println("clip = " + g.getClip());
crwooda at 2007-7-12 14:45:42 > top of Java-index,Desktop,Core GUI APIs...