~ubuntu-branches/ubuntu/trusty/pango1.0/trusty-proposed

« back to all changes in this revision

Viewing changes to examples/cairotwisted.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2009-09-09 07:49:30 UTC
  • mfrom: (1.6.1 upstream) (63.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090909074930-zlgadwz6svi311vh
Tags: 1.25.6-1
New upstream development release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
 
212
212
/* Compute parametrization info.  That is, for each part of the 
213
213
 * cairo path, tags it with its length.
 
214
 *
 
215
 * Free returned value with g_free().
214
216
 */
215
217
static parametrization_t *
216
218
parametrize_path (cairo_path_t *path)
219
221
  cairo_path_data_t *data, last_move_to, current_point;
220
222
  parametrization_t *parametrization;
221
223
 
222
 
  parametrization = malloc (path->num_data * sizeof (parametrization[0]));
 
224
  parametrization = g_malloc (path->num_data * sizeof (parametrization[0]));
223
225
 
224
226
  for (i=0; i < path->num_data; i += path->data[i].header.length) {
225
227
    data = &path->data[i];
454
456
                  (transform_point_func_t) point_on_path, &param);
455
457
 
456
458
  cairo_append_path (cr, current_path);
 
459
 
 
460
  cairo_path_destroy (current_path);
 
461
  g_free (param.parametrization);
457
462
}
458
463
 
459
464
 
528
533
  draw_text (cr, x, y, font, text);
529
534
  map_path_onto (cr, path);
530
535
 
 
536
  cairo_path_destroy (path);
 
537
 
531
538
  cairo_fill_preserve (cr);
532
539
 
533
540
  cairo_save (cr);