Grx.Context.new_subcontext

function new_subcontext(x1: Number(gint), y1: Number(gint), x2: Number(gint), y2: Number(gint), parent: Grx.Context, where: Grx.Context): Grx.Context {
    // Gjs wrapper for grx_context_new_subcontext()
}
  

Creates a new sub-context which maps to a part of an existing context.

The coordinate arguments (x1 through y2) are interpreted relative to the parent context's limits. Pixel addressing is zero-based even in sub-contexts, i.e. the address of the top left pixel is (0,0) even in a sub-context which has been mapped onto the interior of its parent context.

x1

the left bounds

y1

the top bounds

x2

the right bounds

y2

the bottom bounds

parent

the parent context or null to use the screen

where

an unused Grx.Context struct to hold the subcontext or null

Returns

where or a new context if where was null. Return null on error.