diff options
author | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2015-01-18 20:52:11 +0000 |
---|---|---|
committer | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2015-01-18 20:52:11 +0000 |
commit | 2b99b024cbc9fabb792d8014bbeeb3125430a2fa (patch) | |
tree | ae9abd2ab7c92528e6dc84d6ca2cc512172479a3 /navit | |
parent | da5c8824fb31d65ce807c0e86256041db5d99479 (diff) | |
download | navit-svn-2b99b024cbc9fabb792d8014bbeeb3125430a2fa.tar.gz |
Fix:core:Fix regressions of svn 5989. Do not crash if gps_status width is not specified, draw circle around osd_speedwarner, fix comment of attr_rel2real.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5997 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit')
-rw-r--r-- | navit/attr.c | 2 | ||||
-rw-r--r-- | navit/osd/core/osd_core.c | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/navit/attr.c b/navit/attr.c index e884155c..d6a47a36 100644 --- a/navit/attr.c +++ b/navit/attr.c @@ -982,7 +982,7 @@ attr_types_contains_default(enum attr_type *types, enum attr_type type, int defl * @param whole Range counted as 100%. * @param treat_neg_as_rel Replace negative absolute values with whole+attr.u.num. * - * @return True if the attribute type was found, false if it was not found, {@code deflt} if types is empty. + * @return Absolute value corresponding to given relative value. */ int attr_rel2real(int attrval, int whole, int treat_neg_as_rel) { diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index 1d17545f..0fbb9d1c 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -2396,6 +2396,11 @@ osd_speed_warner_init(struct osd_priv_common *opc, struct navit *nav) osd_set_std_graphic(nav, &opc->osd_item, (struct osd_priv *)opc); navit_add_callback(nav, callback_new_attr_1(callback_cast(osd_speed_warner_draw), attr_position_coord_geo, opc)); + this->d=opc->osd_item.w; + if (opc->osd_item.h < this->d) + this->d=opc->osd_item.h; + this->width=this->d/10; + if(this->label_str && !strncmp("images:",this->label_str,7)) { char *tok1=NULL, *tok2=NULL, *tok3=NULL; strtok(this->label_str,":"); @@ -2490,10 +2495,6 @@ osd_speed_warner_new(struct navit *nav, struct osd_methods *meth, struct attr ** else this->announce_on = 1; //announce by default osd_set_std_attr(attrs, &opc->osd_item, 2); - this->d=opc->osd_item.w; - if (opc->osd_item.h < this->d) - this->d=opc->osd_item.h; - this->width=this->d/10; navit_add_callback(nav, callback_new_attr_1(callback_cast(osd_speed_warner_init), attr_graphics_ready, opc)); return (struct osd_priv *) opc; } @@ -3244,7 +3245,7 @@ osd_gps_status_new(struct navit *nav, struct osd_methods *meth, opc->osd_item.rel_y = -80; opc->osd_item.rel_w = 60; opc->osd_item.navit = nav; - opc->osd_item.h = 40; + opc->osd_item.rel_h = 40; opc->osd_item.font_size = 200; opc->osd_item.meth.draw = osd_draw_cast(osd_gps_status_draw); meth->set_attr = set_std_osd_attr; |