skinny up the lines used to draw the clock cursor

This commit is contained in:
Paul Davis 2015-09-24 11:14:53 -04:00
parent 90e1e37c31
commit 71b378e06a

View file

@ -334,12 +334,15 @@ AudioClock::render (cairo_t* cr, cairo_rectangle_t*)
cairo_scale (cr, xscale, yscale); cairo_scale (cr, xscale, yscale);
} }
cairo_move_to (cr, layout_x_offset, layout_y_offset); /* show the actual clock layout */
cairo_move_to (cr, layout_x_offset, layout_y_offset);
pango_cairo_show_layout (cr, _layout->gobj()); pango_cairo_show_layout (cr, _layout->gobj());
if (editing) { if (editing) {
Pango::Rectangle cursor; Pango::Rectangle cursor;
const double scaled_x_half_pixel = 0.5/xscale;
const double scaled_y_half_pixel = 0.5/yscale;
if (!insert_map.empty()) { if (!insert_map.empty()) {
@ -348,12 +351,13 @@ AudioClock::render (cairo_t* cr, cairo_rectangle_t*)
cursor = _layout->get_cursor_strong_pos (edit_string.length() - 1); cursor = _layout->get_cursor_strong_pos (edit_string.length() - 1);
cairo_set_source_rgba (cr, cursor_r, cursor_g, cursor_b, cursor_a); cairo_set_source_rgba (cr, cursor_r, cursor_g, cursor_b, cursor_a);
cairo_set_line_width (cr, (1.0/xscale));
cairo_rectangle (cr, cairo_rectangle (cr,
layout_x_offset + (cursor.get_x()/PANGO_SCALE), layout_x_offset + (cursor.get_x()/PANGO_SCALE) + scaled_x_half_pixel,
layout_y_offset, layout_y_offset + scaled_y_half_pixel,
em_width, em_width,
layout_height); layout_height - (1.0/yscale));
cairo_stroke (cr); cairo_stroke (cr);
} else { } else {
@ -365,23 +369,24 @@ AudioClock::render (cairo_t* cr, cairo_rectangle_t*)
if (edit_string.empty()) { if (edit_string.empty()) {
cairo_rectangle (cr, cairo_rectangle (cr,
layout_x_offset + get_width() - em_width, layout_x_offset + get_width() - em_width + scaled_x_half_pixel,
layout_y_offset, layout_y_offset + scaled_y_half_pixel,
em_width, em_width,
upper_height - layout_y_offset); upper_height - layout_y_offset - (1.0/yscale));
} else { } else {
cursor = _layout->get_cursor_strong_pos (edit_string.length() - 1); cursor = _layout->get_cursor_strong_pos (edit_string.length() - 1);
cairo_rectangle (cr, cairo_rectangle (cr,
layout_x_offset + (cursor.get_x()/PANGO_SCALE), layout_x_offset + (cursor.get_x()/PANGO_SCALE) + scaled_x_half_pixel,
layout_y_offset, layout_y_offset + scaled_y_half_pixel,
em_width, em_width,
upper_height - layout_y_offset); upper_height - layout_y_offset - (1.0/yscale));
} }
cairo_stroke (cr); cairo_stroke (cr);
} }
} }
if (xscale != 1.0 || yscale != 1.0) { if (xscale != 1.0 || yscale != 1.0) {
cairo_restore (cr); cairo_restore (cr);
} }