+2008-02-03 Jim Evins <evins@snaught.com>
+
+ * src/label-image.c: (gl_label_image_class_init), (set_size):
+ Enforce minimum size for images.
+
2008-02-03 Jim Evins <evins@snaught.com>
* src/object-editor-lsize-page.c: (gl_object_editor_set_max_lsize):
#include "debug.h"
+
+#define MIN_IMAGE_SIZE 1.0
+
+
/*========================================================*/
/* Private types. */
/*========================================================*/
static void copy (glLabelObject *dst_object,
glLabelObject *src_object);
+static void set_size (glLabelObject *object,
+ gdouble w,
+ gdouble h);
+
static void draw_object (glLabelObject *object,
cairo_t *cr,
gboolean screen_flag,
gl_label_image_parent_class = g_type_class_peek_parent (class);
label_object_class->copy = copy;
+ label_object_class->set_size = set_size;
label_object_class->draw_object = draw_object;
label_object_class->draw_shadow = NULL;
}
+/*---------------------------------------------------------------------------*/
+/* PRIVATE. Set size method. */
+/*---------------------------------------------------------------------------*/
+static void
+set_size (glLabelObject *object,
+ gdouble w,
+ gdouble h)
+{
+ g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
+
+ if (w < MIN_IMAGE_SIZE)
+ {
+ w = MIN_IMAGE_SIZE;
+ }
+
+ if (h < MIN_IMAGE_SIZE)
+ {
+ h = MIN_IMAGE_SIZE;
+ }
+
+ GL_LABEL_OBJECT_CLASS (gl_label_image_parent_class)->set_size (object, w, h);
+}
+
+
/*****************************************************************************/
/* Set object params. */
/*****************************************************************************/