mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-10 15:10:14 +01:00
[cairo-meta/analysis-surface] Make width/height of -1,-1 mean unbounded surface
This commit is contained in:
parent
a6eb9be106
commit
af1e168bbb
2 changed files with 14 additions and 4 deletions
|
|
@ -673,10 +673,17 @@ _cairo_analysis_surface_create (cairo_surface_t *target,
|
|||
_cairo_region_init (&surface->supported_region);
|
||||
_cairo_region_init (&surface->fallback_region);
|
||||
|
||||
surface->current_clip.x = 0;
|
||||
surface->current_clip.y = 0;
|
||||
surface->current_clip.width = width;
|
||||
surface->current_clip.height = height;
|
||||
if (width == -1 && height == -1) {
|
||||
surface->current_clip.x = CAIRO_RECT_INT_MIN;
|
||||
surface->current_clip.y = CAIRO_RECT_INT_MIN;
|
||||
surface->current_clip.width = CAIRO_RECT_INT_MAX - CAIRO_RECT_INT_MIN;
|
||||
surface->current_clip.height = CAIRO_RECT_INT_MAX - CAIRO_RECT_INT_MIN;
|
||||
} else {
|
||||
surface->current_clip.x = 0;
|
||||
surface->current_clip.y = 0;
|
||||
surface->current_clip.width = width;
|
||||
surface->current_clip.height = height;
|
||||
}
|
||||
|
||||
return &surface->base;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -570,6 +570,9 @@ _cairo_meta_surface_get_extents (void *abstract_surface,
|
|||
{
|
||||
cairo_meta_surface_t *surface = abstract_surface;
|
||||
|
||||
if (surface->width_pixels == -1 && surface->height_pixels == -1)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
rectangle->x = 0;
|
||||
rectangle->y = 0;
|
||||
rectangle->width = surface->width_pixels;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue