diff options
author | jstebbins <[email protected]> | 2009-04-16 22:32:41 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-04-16 22:32:41 +0000 |
commit | 77cd601ed19a9d289daf8225d87a61f302a9c5f7 (patch) | |
tree | 89624aa621f3207a22dd7082f463053e9f7bd220 | |
parent | abbb574581cf09d09605e5acc2eef96c2fba1657 (diff) |
LinGui: a couple bug fixes
- cropping arithmatic error
- uninitialized pointer reference in hud compositor
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2333 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/ghbcompositor.c | 50 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 4 |
2 files changed, 27 insertions, 27 deletions
diff --git a/gtk/src/ghbcompositor.c b/gtk/src/ghbcompositor.c index 11e1441f5..df437ee0b 100644 --- a/gtk/src/ghbcompositor.c +++ b/gtk/src/ghbcompositor.c @@ -288,21 +288,21 @@ ghb_compositor_new (void) static void showtype(const gchar *msg, GtkWidget *widget) { - GType type; - gchar *str; - - type = GTK_WIDGET_TYPE(widget); - if (type == GTK_TYPE_DRAWING_AREA) - str = "drawing area"; - else if (type == GTK_TYPE_ALIGNMENT) - str = "alignment"; - else if (type == GTK_TYPE_EVENT_BOX) - str = "event box"; - else if (type == GTK_TYPE_EVENT_BOX) - str = "event box"; - else - str = "unknown"; - g_message("%s: %s", msg, str); + GType type; + gchar *str; + + type = GTK_WIDGET_TYPE(widget); + if (type == GTK_TYPE_DRAWING_AREA) + str = "drawing area"; + else if (type == GTK_TYPE_ALIGNMENT) + str = "alignment"; + else if (type == GTK_TYPE_EVENT_BOX) + str = "event box"; + else if (type == GTK_TYPE_EVENT_BOX) + str = "event box"; + else + str = "unknown"; + g_message("%s: %s", msg, str); } #endif @@ -354,7 +354,6 @@ ghb_compositor_zlist_insert ( gint z_pos, gdouble opacity) { - GtkWidget *widget; GhbCompositorChild *cc; GdkDisplay *display; @@ -362,20 +361,20 @@ ghb_compositor_zlist_insert ( g_return_if_fail (GTK_IS_WIDGET (child)); g_return_if_fail (child->parent == NULL); - widget = GTK_WIDGET (compositor); - - cc = g_new(GhbCompositorChild, 1); - cc->widget = child; - cc->z_pos = z_pos; - cc->opacity = opacity; - compositor->children = g_list_insert_sorted( - compositor->children, cc, zsort); - gtk_widget_set_parent(child, GTK_WIDGET(compositor)); display = gtk_widget_get_display (GTK_WIDGET(compositor)); if (gdk_display_supports_composite(display)) { + + cc = g_new(GhbCompositorChild, 1); + cc->widget = child; + cc->z_pos = z_pos; + cc->opacity = opacity; + cc->drawables = NULL; + compositor->children = g_list_insert_sorted( + compositor->children, cc, zsort); + GList *link; cc->drawables = find_drawables(NULL, cc->widget); @@ -604,6 +603,7 @@ ghb_compositor_blend (GtkWidget *widget, GdkEventExpose *event) cairo_t *cr; GhbCompositorChild *cc; + if (compositor->children == NULL) return; /* create a cairo context to draw to the window */ cr = gdk_cairo_create (widget->window); diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index eae2f1f2b..8ff42aac4 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -2693,8 +2693,8 @@ ghb_set_scale(signal_user_data_t *ud, gint mode) // Adjust the cropping to accomplish the desired width and height crop_width = tinfo.width - crop[2] - crop[3]; crop_height = tinfo.height - crop[0] - crop[1]; - width = MOD_ROUND(crop_width, mod); - height = MOD_ROUND(crop_height, mod); + width = MOD_DOWN(crop_width, mod); + height = MOD_DOWN(crop_height, mod); need1 = (crop_height - height) / 2; need2 = crop_height - height - need1; |