summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wildemann <metalstrolch@metalstrolche.de>2016-01-06 11:07:12 +0100
committerStefan Wildemann <metalstrolch@metalstrolche.de>2016-01-06 11:09:59 +0100
commit973cba574582138838ea8a95448d4647a12563a7 (patch)
tree1346fb0acb35103219dcf7b71cb10be7814ba485
parentb7d8ec97f64c3b5423649788023d45dcebd2cd81 (diff)
downloadnavit-973cba574582138838ea8a95448d4647a12563a7.tar.gz
fix:osd: Convert zero button size to magic indicator size -1
-rw-r--r--navit/osd/core/osd_core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c
index 4c90cf7ea..922947ab3 100644
--- a/navit/osd/core/osd_core.c
+++ b/navit/osd/core/osd_core.c
@@ -1497,7 +1497,12 @@ osd_button_init(struct osd_priv_common *opc, struct navit *nav)
/* translate properties to real size */
osd_std_calculate_sizes(&opc->osd_item, navit_get_width(nav), navit_get_height(nav));
-
+ /* most graphics plugins cannot accept w=0 or h=0. They require special w=-1 or h=-1 for "no size"*/
+ if((opc->osd_item.w <= 0) || (opc->osd_item.h <=0))
+ {
+ opc->osd_item.w = -1;
+ opc->osd_item.h = -1;
+ }
dbg(lvl_debug, "enter\n");
dbg(lvl_debug, "Get: %s, %d, %d, %d, %d\n", this->src, opc->osd_item.rel_w, opc->osd_item.rel_h, opc->osd_item.w, opc->osd_item.h);
this->img = graphics_image_new_scaled(gra, this->src, opc->osd_item.w, opc->osd_item.h);