Summary:
The default unit of gradient value is percentage.
This can be a value from 0 to 1.
If svg use the '%' symbol, we must divide by 100.
And it must be calculated the same as any other case.
Test Plan: N/A
Reviewers: Hermet, smohanty
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8590
double parsed_value = strtod(str, &end);
double max = 1;
- /* unique case, if that is percentage, just return it */
- if (strstr(str, "%"))
- {
- parsed_value = parsed_value / 100.0;
- return parsed_value;
- }
-
/**
* That is according to Units in here
*
max = sqrt(pow(svg_parse->global.height, 2) +
pow(svg_parse->global.width, 2)) / sqrt(2.0);
- if (strstr(str, "cm"))
+ if (strstr(str, "%"))
+ parsed_value = parsed_value / 100.0;
+ else if (strstr(str, "cm"))
parsed_value = parsed_value * 35.43307;
else if (strstr(str, "mm"))
parsed_value = parsed_value * 3.543307;