aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generic/Rectangle.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/generic/Rectangle.c b/generic/Rectangle.c
index f9a53f3..8306bc4 100644
--- a/generic/Rectangle.c
+++ b/generic/Rectangle.c
@@ -139,7 +139,7 @@ RectTileChange(ClientData client_data,
{
RectangleItem rect = (RectangleItem) client_data;
- InvalidateImage(rect->tile);
+ InvalidateImage(rect->tile_name);
ITEM.Invalidate((Item) rect, ZN_COORDS_FLAG);
}
@@ -279,13 +279,13 @@ Destroy(Item item)
WidgetInfo *wi = item->wi;
RectangleItem rect = (RectangleItem) item;
- if (strlen(rect->tile_name) != 0) {
- ZnFree(rect->tile_name);
- }
if (rect->tile != ZnUnspecifiedImage) {
Tk_FreeImage(rect->tile);
rect->tile = ZnUnspecifiedImage;
}
+ if (strlen(rect->tile_name) != 0) {
+ ZnFree(rect->tile_name);
+ }
if (rect->gradient) {
ZnFreeColorGradient(rect->gradient);
}
@@ -315,10 +315,9 @@ Configure(Item item,
{
WidgetInfo *wi = item->wi;
RectangleItem rect = (RectangleItem) item;
+ int status = ZN_OK;
- if (ITEM_P.ConfigureAttributes((char *) item, -1, argc, argv, flags) == ZN_ERROR) {
- return ZN_ERROR;
- }
+ status = ITEM_P.ConfigureAttributes((char *) item, -1, argc, argv, flags);
if (rect->gradient &&
(ISSET(*flags, ZN_BORDER_FLAG) || (rect->relief == RELIEF_FLAT))) {
@@ -340,7 +339,7 @@ Configure(Item item,
* The name will not be in sync with the image in
* this case.
*/
- return ZN_ERROR;
+ status = ZN_ERROR;
}
}
else {
@@ -352,7 +351,7 @@ Configure(Item item,
rect->tile = tile;
}
- return ZN_OK;
+ return status;
}
@@ -516,7 +515,7 @@ Draw(Item item)
if (ISSET(rect->flags, FILLED_BIT)) {
values.foreground = ZnPixel(rect->fill_color);
if (rect->tile != ZnUnspecifiedImage) { /* Fill tiled */
- Pixmap pmap = GetImagePixmap(wi->win, rect->tile);
+ Pixmap pmap = GetImagePixmap(wi->win, rect->tile_name, rect->tile, NULL);
values.fill_style = FillTiled;
values.tile = pmap;
values.ts_x_origin = (int) item->item_bounding_box.orig.x;