check_min_arg_count(1);
edje_file->base_scale = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0));
- if (edje_file->base_scale == ZERO)
+ if (EQ(edje_file->base_scale, ZERO))
{
ERR("The base_scale is 0.0. The value should be bigger than 0.0.");
exit(-1);
exit(-1);
}
- if (!strcmp (parent_name, "default") && parent_val == 0.0)
+ if (!strcmp (parent_name, "default") && EINA_DBL_CMP(parent_val, 0.0))
parent = ep->default_desc;
else
{
}
}
- if (min_dst)
- {
+ if (EINA_DBL_CMP(min_dst, 0.0))
+ {
WRN("%s:%i: couldn't find an exact match in part '%s' when looking for '%s' %lf. Falling back to nearest one '%s' %lf.",
file_in, line - 1, ep->name, parent_name, parent_val, parent ? parent->state.name : NULL, parent ? parent->state.value : 0);
}
Edje_Part *ep = current_part;
if (ed == ep->default_desc) return;
- if ((ep->default_desc->state.name && !strcmp(ed->state.name, ep->default_desc->state.name) && ed->state.value == ep->default_desc->state.value) ||
- (!ep->default_desc->state.name && !strcmp(ed->state.name, "default") && ed->state.value == ep->default_desc->state.value))
+ if ((ep->default_desc->state.name &&
+ !strcmp(ed->state.name, ep->default_desc->state.name) &&
+ EQ(ed->state.value, ep->default_desc->state.value)) ||
+ (!ep->default_desc->state.name &&
+ !strcmp(ed->state.name, "default") &&
+ EQ(ed->state.value, ep->default_desc->state.value)))
{
if (ep->type == EDJE_PART_TYPE_IMAGE)
_edje_part_description_image_remove((Edje_Part_Description_Image*) ed);
unsigned int i;
for (i = 0; i < ep->other.desc_count - 1; ++i)
{
- if (!strcmp(ed->state.name, ep->other.desc[i]->state.name) && ed->state.value == ep->other.desc[i]->state.value)
+ if (!strcmp(ed->state.name, ep->other.desc[i]->state.name) &&
+ EQ(ed->state.value, ep->other.desc[i]->state.value))
{
if (ep->type == EDJE_PART_TYPE_IMAGE)
_edje_part_description_image_remove((Edje_Part_Description_Image*) ed);
val = parse_float_range(1, 0.0, 1.0);
/* if only default desc exists and current desc is not default, commence paddling */
- if ((!ep->other.desc_count) && (val || (!eina_streq(s, "default"))))
+ if ((!ep->other.desc_count) &&
+ (!EINA_DBL_CMP(val, 0) || (!eina_streq(s, "default"))))
{
ERR("parse error %s:%i. invalid state name: '%s'. \"default\" state must always be first.",
file_in, line - 1, s);