GUAC-236: Ensure rectangle is explicitly set when painting buffers.

This commit is contained in:
Michael Jumper 2016-02-28 00:52:57 -08:00
parent bd84315824
commit 83beccf7e4
2 changed files with 9 additions and 1 deletions

View File

@ -96,8 +96,8 @@ int guacenc_buffer_resize(guacenc_buffer* buffer, int width, int height) {
/* Copy old surface, if defined */
if (buffer->surface != NULL) {
cairo_set_source_surface(cairo, buffer->surface, 0, 0);
cairo_rectangle(cairo, 0, 0, width, height);
cairo_paint(cairo);
cairo_set_source_rgba(cairo, 0.0, 0.0, 0.0, 1.0);
}
/* Update properties */

View File

@ -134,8 +134,16 @@ int guacenc_image_stream_end(guacenc_image_stream* stream,
/* Draw surface to buffer */
if (buffer->cairo != NULL) {
/* Get surface dimensions */
int width = cairo_image_surface_get_width(surface);
int height = cairo_image_surface_get_height(surface);
/* Paint surface contents to buffer */
cairo_set_source_surface(buffer->cairo, surface, stream->x, stream->y);
cairo_rectangle(buffer->cairo, stream->x, stream->y, width, height);
cairo_fill(buffer->cairo);
}
cairo_surface_destroy(surface);