const PsppireDict *dict = de->data_store->dict;
struct variable *var = psppire_dict_get_variable (dict, unit);
+ if (NULL == var)
+ return;
+
var_set_display_width (var, size / (float) width_of_m (w));
}
const struct variable *var = psppire_dict_get_variable (dict, posn);
- psppire_axis_impl_resize (de->haxis, posn, m_width *
- var_get_display_width (var));
+ gint var_width = var_get_display_width (var);
+
+ /* Don't allow zero width */
+ if ( var_width < 1 )
+ var_width = 1;
+
+ psppire_axis_impl_resize (de->haxis, posn, m_width * var_width);
}