[pattern] Split the translation between the matrix and [xy]_offset
pixman limits the src] co-ordinates (and thus [xy]_offset] to 16bits, so we need to be careful how much of the translation vector to push into [xy]_offset. Since the range is the same for both, split the integer component between the matrix and the offset. test/scale-offset* now at least shows the source image, even if it is misplaced.
|
|
@ -2000,8 +2000,11 @@ _cairo_pattern_acquire_surface_for_surface (const cairo_surface_pattern_t *pat
|
|||
assert (invert_status == CAIRO_STATUS_SUCCESS);
|
||||
|
||||
if (m.x0 != 0. || m.y0 != 0.) {
|
||||
x = floor (m.x0);
|
||||
y = floor (m.y0);
|
||||
/* pixman also limits the [xy]_offset to 16 bits so evenly
|
||||
* spread the bits between the two.
|
||||
*/
|
||||
x = floor (m.x0 / 2);
|
||||
y = floor (m.y0 / 2);
|
||||
attr->x_offset -= x;
|
||||
attr->y_offset -= y;
|
||||
cairo_matrix_init_translate (&m, x, y);
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.7 KiB |