diff options
-rw-r--r-- | generic/Item.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/generic/Item.c b/generic/Item.c index a81b16c..5a7b92f 100644 --- a/generic/Item.c +++ b/generic/Item.c @@ -115,8 +115,8 @@ RadarAttrConfig field_attrs[] = { Tk_Offset(FieldStruct, flags), FILLED_BIT, RADAR_COORDS_FLAG, False }, { RADAR_CONFIG_PATTERN, "-fillpattern", NULL, Tk_Offset(FieldStruct, fill_pattern), 0, RADAR_DRAW_FLAG, False }, - { RADAR_CONFIG_FONT|RADAR_CLFC_FLAG, "-font", NULL, - Tk_Offset(FieldStruct, font), 0, RADAR_DRAW_FLAG, False }, + { RADAR_CONFIG_FONT, "-font", NULL, + Tk_Offset(FieldStruct, font), 0, RADAR_DRAW_FLAG|RADAR_CLFC_FLAG, False }, { RADAR_CONFIG_IMAGE, "-image", NULL, Tk_Offset(FieldStruct, image_name), 0, RADAR_COORDS_FLAG|RADAR_IMAGE_FLAG|RADAR_CLFC_FLAG, False }, @@ -770,7 +770,7 @@ ConfigureAttributes(char *record, } if (relief != *((ReliefStyle *) valp)) { /*printf("valp <0x%X>, flags <0x%X>, relief %d\n", valp, flags, relief);*/ - *((ReliefStyle *) valp) = relief; + *((ReliefStyle *) valp) = (ReliefStyle) relief; *flags |= desc->flags; } break; @@ -1825,8 +1825,8 @@ ComputeFieldAttachment(FieldSet field_set, * its cache is ok to break any deadlocks. */ field_ptr->orig_x = field_ptr->orig_y = 0; - field_ptr->corner_x = (short) real_width; - field_ptr->corner_y = (short) real_height; + field_ptr->corner_x = real_width; + field_ptr->corner_y = real_height; SET(field_ptr->flags, CACHE_OK); /* @@ -2045,17 +2045,15 @@ GetLabelBBox(FieldSet field_set, num_fields = LabelFormatNumFields(lf); for (i = 0; i < num_fields; i++) { ComputeFieldAttachment(field_set, i, &tmp_bbox); + /*printf("field %d bbox %g %g %g %g\n", i, tmp_bbox.orig.x, tmp_bbox.orig.y, + tmp_bbox.corner.x, tmp_bbox.corner.y);*/ AddBBoxToBBox(&bbox, &tmp_bbox); } - field_set->label_width = (RadarDim) (bbox.corner.x - bbox.orig.x); - field_set->label_height = (RadarDim) (bbox.corner.y - bbox.orig.y); - if (bbox.orig.x < 0) { - field_set->label_width += (RadarDim) bbox.orig.x; - } - if (bbox.orig.y < 0) { - field_set->label_height += (RadarDim) bbox.orig.y; - } + field_set->label_width = bbox.corner.x; + field_set->label_height = bbox.corner.y; + /*printf("GetLabelBBox size before clipping; w = %g, h = %g\n", + field_set->label_width, field_set->label_height);*/ if (LabelFormatGetClipBox(lf, &clip_w, &clip_h)) { if (clip_w < field_set->label_width) { field_set->label_width = clip_w; @@ -2067,6 +2065,7 @@ GetLabelBBox(FieldSet field_set, *w = field_set->label_width; *h = field_set->label_height; + /*printf("GetLabelBBox returns computed size; w = %g, h = %g\n", *w, *h);*/ } |