forked from enlightenment/efl
Fix the calculation double type number.
Round off to the nearest whole number.
This commit is contained in:
parent
87fc1389b9
commit
0337f1ad68
|
@ -1242,3 +1242,8 @@
|
||||||
|
|
||||||
* Add the API elm_scroller_single_direction_set/get.
|
* Add the API elm_scroller_single_direction_set/get.
|
||||||
This sets how the content is scrolled.
|
This sets how the content is scrolled.
|
||||||
|
|
||||||
|
2013-04-10 Jaehwan Kim
|
||||||
|
|
||||||
|
* Fix the calculation double type number.
|
||||||
|
Round off to the nearest whole number.
|
||||||
|
|
|
@ -205,6 +205,7 @@ Fixes:
|
||||||
* Fix the scroller show by a page if the page size is set and the region_bring_in or region_show is called.
|
* Fix the scroller show by a page if the page size is set and the region_bring_in or region_show is called.
|
||||||
* Fix elc_player crash issue.
|
* Fix elc_player crash issue.
|
||||||
* Fix the region_show/region_bring_in don't have a limit at a paging movement.
|
* Fix the region_show/region_bring_in don't have a limit at a paging movement.
|
||||||
|
* Fix the calculation double type number.
|
||||||
|
|
||||||
Removals:
|
Removals:
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,18 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
||||||
|
|
||||||
static void _elm_pan_content_set(Evas_Object *, Evas_Object *);
|
static void _elm_pan_content_set(Evas_Object *, Evas_Object *);
|
||||||
|
|
||||||
|
static double
|
||||||
|
_round(double value, int pos)
|
||||||
|
{
|
||||||
|
double temp;
|
||||||
|
|
||||||
|
temp = value * pow( 10, pos );
|
||||||
|
temp = floor( temp + 0.5 );
|
||||||
|
temp *= pow( 10, -pos );
|
||||||
|
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_elm_pan_update(Elm_Pan_Smart_Data *psd)
|
_elm_pan_update(Elm_Pan_Smart_Data *psd)
|
||||||
{
|
{
|
||||||
|
@ -928,8 +940,8 @@ _elm_scroll_scroll_bar_read_and_update(
|
||||||
(sid->edje_obj, "elm.dragable.hbar", &vx, NULL);
|
(sid->edje_obj, "elm.dragable.hbar", &vx, NULL);
|
||||||
eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
|
eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
|
||||||
eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
|
eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
|
||||||
x = vx * (double)mx + minx;
|
x = _round(vx * (double)mx + minx, 1);
|
||||||
y = vy * (double)my + miny;
|
y = _round(vy * (double)my + miny, 1);
|
||||||
eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
|
eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
|
||||||
eo_do(sid->pan_obj, elm_obj_pan_pos_set(x, y));
|
eo_do(sid->pan_obj, elm_obj_pan_pos_set(x, y));
|
||||||
if ((px != x) || (py != y))
|
if ((px != x) || (py != y))
|
||||||
|
|
Loading…
Reference in New Issue