219
219
state = rsvg_current_state (ctx);
220
220
if (RSVG_NODE_TYPE (child) != RSVG_NODE_TYPE_SYMBOL) {
221
_rsvg_affine_translate (affine, x, y);
222
_rsvg_affine_multiply (state->affine, affine, state->affine);
221
cairo_matrix_init_translate (&affine, x, y);
222
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
224
224
rsvg_push_discrete_layer (ctx);
225
225
rsvg_state_push (ctx);
232
232
if (symbol->vbox.active) {
233
233
rsvg_preserve_aspect_ratio
234
(symbol->preserve_aspect_ratio, symbol->vbox.w, symbol->vbox.h, &w, &h, &x, &y);
236
_rsvg_affine_translate (affine, x, y);
237
_rsvg_affine_multiply (state->affine, affine, state->affine);
238
_rsvg_affine_scale (affine, w / symbol->vbox.w, h / symbol->vbox.h);
239
_rsvg_affine_multiply (state->affine, affine, state->affine);
240
_rsvg_affine_translate (affine, -symbol->vbox.x, -symbol->vbox.y);
241
_rsvg_affine_multiply (state->affine, affine, state->affine);
243
_rsvg_push_view_box (ctx, symbol->vbox.w, symbol->vbox.h);
234
(symbol->preserve_aspect_ratio,
235
symbol->vbox.rect.width, symbol->vbox.rect.height,
238
cairo_matrix_init_translate (&affine, x, y);
239
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
241
cairo_matrix_init_scale (&affine, w / symbol->vbox.rect.width, h / symbol->vbox.rect.height);
242
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
244
cairo_matrix_init_translate (&affine, -symbol->vbox.rect.x, -symbol->vbox.rect.y);
245
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
247
_rsvg_push_view_box (ctx, symbol->vbox.rect.width, symbol->vbox.rect.height);
244
248
rsvg_push_discrete_layer (ctx);
245
249
if (!state->overflow || (!state->has_overflow && child->state->overflow))
246
rsvg_add_clipping_rect (ctx, symbol->vbox.x, symbol->vbox.y,
247
symbol->vbox.w, symbol->vbox.h);
250
rsvg_add_clipping_rect (ctx, symbol->vbox.rect.x, symbol->vbox.rect.y,
251
symbol->vbox.rect.width, symbol->vbox.rect.height);
249
_rsvg_affine_translate (affine, x, y);
250
_rsvg_affine_multiply (state->affine, affine, state->affine);
253
cairo_matrix_init_translate (&affine, x, y);
254
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
251
255
rsvg_push_discrete_layer (ctx);
281
285
state = rsvg_current_state (ctx);
283
for (i = 0; i < 6; i++)
284
affine_old[i] = state->affine[i];
287
affine_old = state->affine;
286
289
if (sself->vbox.active) {
287
290
double x = nx, y = ny, w = nw, h = nh;
288
291
rsvg_preserve_aspect_ratio (sself->preserve_aspect_ratio,
289
sself->vbox.w, sself->vbox.h, &w, &h, &x, &y);
290
affine[0] = w / sself->vbox.w;
293
affine[3] = h / sself->vbox.h;
294
affine[4] = x - sself->vbox.x * w / sself->vbox.w;
295
affine[5] = y - sself->vbox.y * h / sself->vbox.h;
296
_rsvg_affine_multiply (state->affine, affine, state->affine);
297
_rsvg_push_view_box (ctx, sself->vbox.w, sself->vbox.h);
292
sself->vbox.rect.width, sself->vbox.rect.height,
294
cairo_matrix_init (&affine,
295
w / sself->vbox.rect.width,
298
h / sself->vbox.rect.height,
299
x - sself->vbox.rect.x * w / sself->vbox.rect.width,
300
y - sself->vbox.rect.y * h / sself->vbox.rect.height);
301
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
302
_rsvg_push_view_box (ctx, sself->vbox.rect.width, sself->vbox.rect.height);
305
_rsvg_affine_multiply (state->affine, affine, state->affine);
304
cairo_matrix_init_translate (&affine, nx, ny);
305
cairo_matrix_multiply (&state->affine, &affine, &state->affine);
306
306
_rsvg_push_view_box (ctx, nw, nh);
308
for (i = 0; i < 6; i++)
309
affine_new[i] = state->affine[i];
309
affine_new = state->affine;
311
311
rsvg_push_discrete_layer (ctx);
313
313
/* Bounding box addition must be AFTER the discrete layer push,
314
314
which must be AFTER the transformation happens. */
315
315
if (!state->overflow && self->parent) {
316
for (i = 0; i < 6; i++)
317
state->affine[i] = affine_old[i];
316
state->affine = affine_old;
318
317
rsvg_add_clipping_rect (ctx, nx, ny, nw, nh);
319
for (i = 0; i < 6; i++)
320
state->affine[i] = affine_new[i];
318
state->affine = affine_new;
323
321
for (i = 0; i < self->children->len; i++) {