fixed bad combination of text wrapping options for request dialog
[rocksndiamonds.git] / src / tools.c
index 1dc080b22906ea71c5afa4815509c72c52eae037..9b903d35b337b8e02959b367424a48a4e0c2951b 100644 (file)
@@ -2283,7 +2283,7 @@ void DrawEnvelopeRequest(char *text)
   int text_width = line_length * font_width;
   int width = request.width;
   int height = request.height;
-  int tile_size = request.step_offset;
+  int tile_size = MAX(request.step_offset, 1);
   int x_steps = width  / tile_size;
   int y_steps = height / tile_size;
   int sx_offset = border_size;
@@ -2294,7 +2294,7 @@ void DrawEnvelopeRequest(char *text)
   if (request.centered)
     sx_offset = (request.width - text_width) / 2;
 
-  if (request.wrap_single_words)
+  if (request.wrap_single_words && !request.autowrap)
   {
     char *src_text_ptr, *dst_text_ptr;
 
@@ -2362,7 +2362,7 @@ void AnimateEnvelopeRequest(int anim_mode, int action)
   int anim_delay_value = (no_delay ? 0 : delay_value + 500 * 0) / 2;
   unsigned int anim_delay = 0;
 
-  int tile_size = request.step_offset;
+  int tile_size = MAX(request.step_offset, 1);
   int max_xsize = request.width  / tile_size;
   int max_ysize = request.height / tile_size;
   int max_xsize_inner = max_xsize - 2;