paint_rect
Entity: predicate

Usage:
paint_rect(X1, Y1, X2, Y2)

This predicate is for use with the message paint. With this predicate you can check which is the rectangle which needs to be repainted. In this way you can optimise the processing of message paint and to repaint only this part of the window which needs to be repainted instead of repainting the entire window's client area.

If arguments are not instantiated paint_rect(X1, Y1, X2, Y2) will return in variables (X1, Y1, X2, Y2) left-top and right-bottom corners of the smallest rectangle which includes the area which needs to be repainted.

If arguments are instantiated then paint_rect(X1, Y1, X2, Y2) will make a check if the rectangle (X1, Y1, X2, Y2) overlaps with the area which needs to be repainted (this will give you the possibility to determine more precisely this area).
 

Example:

win_func(paint):-
  paint_rect(X1, Y1, X2, Y2),
  rect(X1, Y1, X2, Y2).
 

See also:
Messages

Look at the example:
Fractals.pro (in folder Programs)