diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-25 18:28:32 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-27 14:59:32 -0500 |
commit | a5e112a73f409d447420bf0dfda46509290ec983 (patch) | |
tree | 375b9dd676ac81bf4369747622d34207aba1b0ae /libs/surfaces/push2 | |
parent | df5bb70616e9838fd112c8dd5141e32df01ca543 (diff) |
push2: correct knob origin translation for drawing
Diffstat (limited to 'libs/surfaces/push2')
-rw-r--r-- | libs/surfaces/push2/knob.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/surfaces/push2/knob.cc b/libs/surfaces/push2/knob.cc index 270aca913b..77fb58f00d 100644 --- a/libs/surfaces/push2/knob.cc +++ b/libs/surfaces/push2/knob.cc @@ -111,7 +111,11 @@ Push2Knob::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) con float value_x = cos (value_angle); float value_y = sin (value_angle); - context->translate (_position.x, _position.y); //after this, everything is based on the center of the knob + /* translate so that all coordinates are based on the center of the + * knob (which is also its position() + */ + Duple origin = item_to_window (Duple (0, 0)); + context->translate (origin.x, origin.y); context->begin_new_path (); float center_radius = 0.48*scale; @@ -134,7 +138,6 @@ Push2Knob::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) con context->arc (0, 0, progress_radius, start_angle, end_angle); context->stroke (); - double red_start, green_start, blue_start, astart; double red_end, green_end, blue_end, aend; @@ -318,6 +321,7 @@ Push2Knob::controllable_changed () case ARDOUR::GainAutomation: case ARDOUR::BusSendLevel: + case ARDOUR::TrimAutomation: set_gain_text (_val); break; |