summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_clock.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2012-11-11 16:27:29 +0000
committerRobin Gareus <robin@gareus.org>2012-11-11 16:27:29 +0000
commit1f149870448010210c6da4d0b1d58a751dc478f9 (patch)
tree32ec2c2994482e792e436ec8c19222e7bc83dd76 /gtk2_ardour/audio_clock.cc
parente1166e326668fbe4267f754a638ff91c671cea40 (diff)
rounding off all clock corners
git-svn-id: svn://localhost/ardour2/branches/3.0@13436 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_clock.cc')
-rw-r--r--gtk2_ardour/audio_clock.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index 88f361de5e..bb1b9f4c43 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -283,7 +283,7 @@ AudioClock::render (cairo_t* cr)
cairo_set_source_rgba (cr, bg_r, bg_g, bg_b, bg_a);
if (corner_radius) {
if (_left_layout) {
- Gtkmm2ext::rounded_top_half_rectangle (cr, 0, 0, get_width(), upper_height, corner_radius);
+ Gtkmm2ext::rounded_top_half_rectangle (cr, 0, 0, get_width() - corner_radius/2.0, upper_height, corner_radius);
} else {
Gtkmm2ext::rounded_rectangle (cr, 0, 0, get_width(), upper_height, corner_radius);
}
@@ -316,7 +316,9 @@ AudioClock::render (cairo_t* cr)
if (_need_bg) {
if (corner_radius) {
- Gtkmm2ext::rounded_bottom_half_rectangle (cr, 0, upper_height + separator_height, left_rect_width, h, corner_radius);
+ Gtkmm2ext::rounded_bottom_half_rectangle (cr, 0, upper_height + separator_height,
+ left_rect_width + (separator_height == 0 ? corner_radius : 0),
+ h - corner_radius/2.0, corner_radius);
} else {
cairo_rectangle (cr, 0, upper_height + separator_height, left_rect_width, h);
}
@@ -328,9 +330,10 @@ AudioClock::render (cairo_t* cr)
if (_need_bg) {
if (corner_radius) {
- Gtkmm2ext::rounded_bottom_half_rectangle (cr, left_rect_width + separator_height, upper_height + separator_height,
- get_width() - separator_height - left_rect_width, h,
- corner_radius);
+ Gtkmm2ext::rounded_bottom_half_rectangle (cr, left_rect_width + separator_height,
+ upper_height + separator_height,
+ get_width() - separator_height - left_rect_width - corner_radius/2.0,
+ h - corner_radius/2.0, corner_radius);
} else {
cairo_rectangle (cr, left_rect_width + separator_height, upper_height + separator_height,
get_width() - separator_height - left_rect_width, h);
@@ -547,6 +550,9 @@ AudioClock::on_size_request (Gtk::Requisition* req)
req->height += separator_height;
}
+ req->height += corner_radius/2.0;
+ req->width += corner_radius/2.0;
+
first_height = req->height;
first_width = req->width;
}
@@ -2177,7 +2183,9 @@ void
AudioClock::set_corner_radius (double r)
{
corner_radius = r;
- queue_draw ();
+ first_width = 0;
+ first_height = 0;
+ queue_resize ();
}
void