[cheese] um-crop-area: Enforce a minimum size
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese] um-crop-area: Enforce a minimum size
- Date: Wed, 7 Jan 2015 15:41:11 +0000 (UTC)
commit 08ff9ff6999157f25b10676fdb088b04ac6f190e
Author: Rui Matos <tiagomatos gmail com>
Date: Wed Jan 7 16:09:30 2015 +0100
um-crop-area: Enforce a minimum size
Otherwise, if callers aren't careful, users could resize us so small
that we'd crash inside gdk_pixbuf_scale() .
https://bugzilla.gnome.org/show_bug.cgi?id=742530
libcheese/um-crop-area.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libcheese/um-crop-area.c b/libcheese/um-crop-area.c
index b8bc662..6a4327e 100644
--- a/libcheese/um-crop-area.c
+++ b/libcheese/um-crop-area.c
@@ -850,6 +850,15 @@ um_crop_area_button_release_event (GtkWidget *widget,
}
static void
+um_crop_area_set_size_request (UmCropArea *area)
+{
+ UmCropAreaPrivate *priv = um_crop_area_get_instance_private (area);
+ gtk_widget_set_size_request (GTK_WIDGET (area),
+ priv->base_width,
+ priv->base_height);
+}
+
+static void
um_crop_area_finalize (GObject *object)
{
UmCropAreaPrivate *priv = um_crop_area_get_instance_private (UM_CROP_AREA (object));
@@ -901,6 +910,8 @@ um_crop_area_init (UmCropArea *area)
priv->base_width = 48;
priv->base_height = 48;
priv->aspect = 1;
+
+ um_crop_area_set_size_request (area);
}
/*
@@ -1005,6 +1016,8 @@ um_crop_area_set_min_size (UmCropArea *area,
priv->base_width = width;
priv->base_height = height;
+ um_crop_area_set_size_request (area);
+
if (priv->aspect > 0) {
priv->aspect = priv->base_width / (gdouble)priv->base_height;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]