_parse_flag(char **content, int *number)
{
char *end = NULL;
- char *end_test = NULL;
- char content_test[strlen(*content) + 1];
- int number_test;
- strcpy(content_test,*content);
- *number = strtol(*content, &end, 10) ? 1 : 0;
- if ((*content) == end) return EINA_FALSE;
- number_test = (int)strtof(content_test, &end_test);
-
- if ((*number != number_test) || (*end != *end_test))
- return EINA_FALSE;
+ *number = strtol(*content, &end, 10);
+ if ((*content) == end || *end == '.') return EINA_FALSE;
+ if (*number != 0 && *number != 1) return EINA_FALSE;
*content = _skipcomma(end);
return EINA_TRUE;
case 'S':
{
double ctrl_x, ctrl_y;
+ ctrl_x = *cur_x;
+ ctrl_y = *cur_y;
if ((svg_path->cmds_cnt > 1) && (svg_path->cmds[svg_path->cmds_cnt - 1] ==
TVG_PATH_COMMAND_CUBIC_TO) && !(*is_quadratic))
{
ctrl_x = *cur_x * 2 - *cur_ctl_x;
ctrl_y = *cur_y * 2 - *cur_ctl_y;
}
- else
- {
- ctrl_x = *cur_x;
- ctrl_y = *cur_y;
- }
if (!_svg_path_grow(svg_path, 3)) break;
svg_path->pts[svg_path->pts_cnt-3].x = ctrl_x;
svg_path->pts[svg_path->pts_cnt-3].y = ctrl_y;
case 'T':
{
double ctrl_x, ctrl_y, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1;
+ ctrl_x = *cur_x;
+ ctrl_y = *cur_y;
if ((svg_path->cmds_cnt > 1) && (svg_path->cmds[svg_path->cmds_cnt - 1] ==
TVG_PATH_COMMAND_CUBIC_TO) && *is_quadratic)
{
ctrl_x = *cur_x * 2 - *cur_ctl_x;
ctrl_y = *cur_y * 2 - *cur_ctl_y;
}
- else
- {
- ctrl_x = *cur_x;
- ctrl_y = *cur_y;
- }
ctrl_x0 = (*cur_x + 2 * ctrl_x) * (1.0 / 3.0);
ctrl_y0 = (*cur_y + 2 * ctrl_y) * (1.0 / 3.0);
ctrl_x1 = (pts[0] + 2 * ctrl_x) * (1.0 / 3.0);