summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-03-31 23:40:23 +0200
committerRobin Gareus <robin@gareus.org>2016-03-31 23:40:23 +0200
commit9ff4938ddd8039b478430988f098167871496b7f (patch)
tree85f65a493daadc9e16cbc4a29aca4d78a3b56cb9 /gtk2_ardour
parent9b39339954bf7f1ce91ef6ef3bc31ea4e2a52358 (diff)
initialize some uninitialized variables
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_button.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index 2d020595ab..ccf45c6121 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -102,6 +102,9 @@ ArdourButton::ArdourButton (Element e)
ArdourButton::ArdourButton (const std::string& str, Element e)
: _elements (e)
, _tweaks (Tweaks (0))
+ , _char_pixel_width (0)
+ , _char_pixel_height (0)
+ , _char_avg_pixel_width (0)
, _text_width (0)
, _text_height (0)
, _diameter (0)
@@ -538,6 +541,7 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
if ((_elements & Text) && !_text.empty()) {
// if _layout does not exist, char_pixel_height() creates it,
req->height = std::max(req->height, (int) ceil(char_pixel_height() * BASELINESTRETCH + 1.0));
+ assert (_layout);
_layout->get_pixel_size (_text_width, _text_height);
req->width += rint(1.75 * char_pixel_width()); // padding
req->width += _text_width;