~fginther/unity/100-scopes-search-tests

« back to all changes in this revision

Viewing changes to unity-shared/DashStyle.cpp

  • Committer: Nick Dedekind
  • Date: 2013-03-12 13:31:41 UTC
  • mfrom: (3008.2.200 trunk)
  • Revision ID: nicholas.dedekind@gmail.com-20130312133141-qrq3x3ighapfd36f
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
978
978
                                         Segment    segment)
979
979
{
980
980
  double radius  = cornerRadius / aspect;
981
 
  bool odd = true;
982
981
 
983
 
  odd = cairo_get_line_width (cr) == 2.0 ? false : true;
 
982
  bool odd = cairo_get_line_width (cr) == 2.0 ? false : true;
984
983
 
985
984
  switch (segment)
986
985
  {
1558
1557
  cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
1559
1558
  cairo_set_source_rgba(cr, color);
1560
1559
  pango_layout_context_changed(layout);
1561
 
  PangoRectangle ink = {0, 0, 0, 0};
1562
 
  PangoRectangle log = {0, 0, 0, 0};
1563
 
  pango_layout_get_extents(layout, &ink, &log);
 
1560
  int layout_w = 0;
 
1561
  int layout_h = 0;
 
1562
  pango_layout_get_pixel_size(layout, &layout_w, &layout_h);
1564
1563
  x = horizMargin; // let pango alignment handle the x position
1565
 
  y = ((double) h - pango_units_to_double(log.height)) / 2.0;
 
1564
  y = (h - layout_h) / 2.0f;
1566
1565
 
1567
1566
  cairo_move_to(cr, x, y);
1568
1567
  pango_cairo_show_layout(cr, layout);