From: Holger Schemel Date: Sun, 25 Jan 2015 19:15:43 +0000 (+0100) Subject: fixed bugs when changing drawing area gadgets (like group elements) X-Git-Tag: 4.0.0.0-rc1~305 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=cf2191ef8a66ae7bba91f80de8d2e6193af44dc4;p=rocksndiamonds.git fixed bugs when changing drawing area gadgets (like group elements) --- diff --git a/ChangeLog b/ChangeLog index a3fa618c..fd54470d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ no function behind it; will be used to zoom level editor playfield) * added key shortcuts '1' to '3' to view properties of drawing elements * fixed gadget display bug in editor (door 1 area) after test playing + * fixed bugs when changing drawing area gadgets (like group elements) 2015-01-19 * re-enabled editor palette element options in setup configuration file diff --git a/src/editor.c b/src/editor.c index bba88fbe..5b1b7560 100644 --- a/src/editor.c +++ b/src/editor.c @@ -7538,8 +7538,6 @@ static void AdjustDrawingAreaGadgets() ed_fieldy = (ed_ysize < MAX_ED_FIELDY ? ed_ysize : max_ed_fieldy); ModifyGadget(level_editor_gadget[GADGET_ID_DRAWING_LEVEL], - GDI_WIDTH, ed_fieldx * MINI_TILEX, - GDI_HEIGHT, ed_fieldy * MINI_TILEY, GDI_AREA_SIZE, ed_fieldx, ed_fieldy, GDI_END); diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 1c52ec5d..9ff99690 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -980,14 +980,12 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap) gi->drawing.area_ysize = va_arg(ap, int); /* determine dependent values for drawing area gadget, if needed */ - if (gi->width == 0 && gi->height == 0 && - gi->drawing.item_xsize !=0 && gi->drawing.item_ysize !=0) + if (gi->drawing.item_xsize != 0 && gi->drawing.item_ysize != 0) { gi->width = gi->drawing.area_xsize * gi->drawing.item_xsize; gi->height = gi->drawing.area_ysize * gi->drawing.item_ysize; } - else if (gi->drawing.item_xsize == 0 && gi->drawing.item_ysize == 0 && - gi->width != 0 && gi->height != 0) + else if (gi->width != 0 && gi->height != 0) { gi->drawing.item_xsize = gi->width / gi->drawing.area_xsize; gi->drawing.item_ysize = gi->height / gi->drawing.area_ysize; @@ -1010,14 +1008,12 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap) gi->drawing.item_ysize = va_arg(ap, int); /* determine dependent values for drawing area gadget, if needed */ - if (gi->width == 0 && gi->height == 0 && - gi->drawing.area_xsize !=0 && gi->drawing.area_ysize !=0) + if (gi->drawing.area_xsize != 0 && gi->drawing.area_ysize != 0) { gi->width = gi->drawing.area_xsize * gi->drawing.item_xsize; gi->height = gi->drawing.area_ysize * gi->drawing.item_ysize; } - else if (gi->drawing.area_xsize == 0 && gi->drawing.area_ysize == 0 && - gi->width != 0 && gi->height != 0) + else if (gi->width != 0 && gi->height != 0) { gi->drawing.area_xsize = gi->width / gi->drawing.item_xsize; gi->drawing.area_ysize = gi->height / gi->drawing.item_ysize;