chaco.image_utils module

chaco.image_utils.trim_screen_rect(screen_rect, view_rect, sub_array_size)

Trim sub-image screen rectangle for highly zoomed in states.

When zoomed into one or two pixels (in any dimension), the screen rectangle for those pixels can extend without bound outside of the plot area. This function will return altered bounds to remove unnecessary rendering.