Jon A. Cruz wrote:
Robert Crosbie wrote:
If a width was defined that exceeded INT_MAX, then when the gdouble was cast to a gint, data would be lost. A user would see a windo much smaller than they exected being displayed.
Ahhh... very good points.
Here ya go. A new and improved patch:
Index: src/help.c =================================================================== RCS file: /cvsroot/inkscape/inkscape/src/help.c,v retrieving revision 1.2 diff -u -r1.2 help.c --- src/help.c 30 Oct 2003 05:52:06 -0000 1.2 +++ src/help.c 14 Nov 2003 05:24:11 -0000 @@ -27,6 +27,9 @@ return FALSE; }
+#define WINDOW_MIN 20 +#define WINDOW_MAX INT_MAX + void sp_help_about (void) { @@ -47,7 +50,11 @@
w = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (w), _("About inkscape")); - gtk_window_set_default_size (GTK_WINDOW (w), sp_document_width (doc), sp_document_height (doc)); + + gint width = INK_STATIC_CAST( gint, CLAMP( sp_document_width(doc), WINDOW_MIN, WINDOW_MAX ) ); + gint height = INK_STATIC_CAST( gint, CLAMP( sp_document_height(doc), WINDOW_MIN, WINDOW_MAX ) ); + gtk_window_set_default_size (GTK_WINDOW (w), width, height ); + #if 1 gtk_window_set_policy (GTK_WINDOW (w), TRUE, TRUE, FALSE); #endif