All Manuals > CAPI User Guide and Reference Manual > 22 GRAPHICS-PORTS Reference Entries

invalidate-rectangle Generic Function

Summary

Invalidates the rectangle associated with the object, which causes it to be redisplayed.

Package

graphics-ports

Signature

invalidate-rectangle object &optional x y width height => result

Arguments
object
An instance of a subclass of graphics-port-mixin or a subclass of pinboard-object.
A real number.
A real number.
width
A real number.
height
A real number.
Values
result
A boolean.
Description

The generic function invalidate-rectangle invalidates the rectangle associated with object, which causes it to be redisplayed.

By default, invalidate-rectangle invalidates the whole rectangle, but this can be limited by supplying x, y, width and height.

The effect of invalidating an area is to cause the area to be redrawn. It has no effect on pixmap-port. When the pane has a supplied display-callback, this callback is called with an area containing the area specified by the argument to invalidate-rectangle. However, the call to display-callback is asynchronous, and the system coalesces areas from calls to invalidate-rectangle and actual expose events, so there is not a one-to-one relation between calls to invalidate-rectangle and invocations of display-callback.

In general, invalidate-rectangle should not be called inside the display-callback. If it is called, it must be conditional, otherwise this will cause repeated redisplay.

Notes

With drawing-mode :quality, drawings are done with anti-aliasing, which means that they affect pixels which are not obviously part of the drawing. For example, drawing a rectangle with x = 10 may affect the pixel at x = 9. This needs to be taken into account when computing the arguments to invalidate-rectangle.

For pinboard objects the recommended way of forcing redraw is redraw-pinboard-object, which takes anti-aliasing into account.

Examples
(example-edit-file "capi/graphics/plot-offline")
See also

invalidate-rectangle-from-points
validate-rectangle
13 Drawing - Graphics Ports


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:44