[SCM] calf/master: VU Meter: Do not select and measure a font if not drawing any text.

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:41:14 UTC 2013


The following commit has been merged in the master branch:
commit e0cac3b649c12e9cede098b302cc3ab2d5b7ba65
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Fri Sep 21 19:33:39 2012 +0100

    VU Meter: Do not select and measure a font if not drawing any text.

diff --git a/src/ctl_vumeter.cpp b/src/ctl_vumeter.cpp
index 19ac19e..114ae38 100644
--- a/src/ctl_vumeter.cpp
+++ b/src/ctl_vumeter.cpp
@@ -54,12 +54,14 @@ calf_vumeter_expose (GtkWidget *widget, GdkEventExpose *event)
     int text_x = 0; int text_y = 0;
     int text_w = 0; int text_h = 0;
     int text_m = 3; // text margin
-    
-    cairo_select_font_face(c, "cairo:sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
-    cairo_set_font_size(c, 8);
+
+    // only valid if vumeter is enabled
     cairo_text_extents_t extents;
     
     if(vu->vumeter_position) {
+        cairo_select_font_face(c, "cairo:sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
+        cairo_set_font_size(c, 8);
+
         cairo_text_extents(c, "-88.88", &extents);
         text_w = extents.width;
         text_h = extents.height;

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list