fixed using buttons on main screen with size other than 32x32 pixels
authorHolger Schemel <info@artsoft.org>
Mon, 20 Oct 2014 21:18:43 +0000 (23:18 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 20 Oct 2014 21:18:43 +0000 (23:18 +0200)
ChangeLog
src/conftime.h
src/screens.c
src/tools.c

index f50d01549bfbc8c6d8d599307464a5d08040c5ba..35d438e21fcc7f172c396d21869bd1bf13be3454 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2014-10-20
+       * fixed using buttons on main screen with size other than 32x32 pixels
+
 2014-10-17
        * removed some remaining unused X11 stuff
        * fixed bug with potentially suppressed exit error message on startup
index ed346741b1143bfa08f1a6ca2f5ff7946d62109b..a8916dbc632d38f9b2f77e420701996d80b9d528 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2014-10-18 00:15"
+#define COMPILE_DATE_STRING "2014-10-20 23:13"
index 0bd9af8403d35c5a2de0cbdc3fb445a98d603b0b..ae35cda2e225c8b999e98111604d95207978218f 100644 (file)
@@ -972,18 +972,19 @@ static void InitializeMainControls()
       /* calculate size for non-clickable text -- needed for text alignment */
       boolean calculate_text_size = (pos_button == NULL && text != NULL);
 
+      if (pos_text->width == -1 || calculate_text_size)
+       pos_text->width = text_width;
+      if (pos_text->height == -1 || calculate_text_size)
+       pos_text->height = text_height;
+
       if (visibleMenuPos(pos_button))
       {
        if (pos_text->x == -1)
          pos_text->x = pos_button->x + pos_button->width;
        if (pos_text->y == -1)
-         pos_text->y = pos_button->y;
+         pos_text->y =
+           pos_button->y + (pos_button->height - pos_text->height) / 2;
       }
-
-      if (pos_text->width == -1 || calculate_text_size)
-       pos_text->width = text_width;
-      if (pos_text->height == -1 || calculate_text_size)
-       pos_text->height = text_height;
     }
 
     if (pos_input != NULL)             /* (x/y may be -1/-1 here) */
index e2ce4712db41208c121239ecaf39204270c6d0c2..a04238724c35f92b03cd788de7ec1efdb411a070 100644 (file)
@@ -1253,12 +1253,14 @@ void DrawGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y, int graphic,
 void DrawFixedGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y,
                                 int graphic, int frame)
 {
+  struct GraphicInfo *g = &graphic_info[graphic];
   Bitmap *src_bitmap;
   int src_x, src_y;
 
   getFixedGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
 
-  BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dst_x, dst_y);
+  BlitBitmapMasked(src_bitmap, d, src_x, src_y, g->width, g->height,
+                  dst_x, dst_y);
 }
 
 void DrawSizedGraphic(int x, int y, int graphic, int frame, int tilesize)