#ifdef BOUNCING_SUPPORT
wd->container = elm_smart_webview_container_add(e);
_elm_smart_webview_container_child_set(wd->container, wd->webkit);
- _elm_smart_webview_container_set(wd->webkit, wd->container);
#endif
_elm_smart_webview_widget_set(wd->webkit, obj);
evas_object_event_callback_add(wd->webkit, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
int dx = sd->pan_s.x - point->x;
int dy = sd->pan_s.y - point->y;
+ if (dx == 0 && dy == 0) return;
if (!sd->ewk_view_frame_main_get)
sd->ewk_view_frame_main_get = (Evas_Object *(*)(const Evas_Object *))dlsym(ewk_handle, "ewk_view_frame_main_get");
#endif
#ifdef BOUNCING_SUPPORT
+ //_elm_smart_webview_container_bounce_add(sd->container, 10, 10);
+ //return;
+
printf(":::::::: %s\n", __func__);
- _elm_smart_webview_container_scroll_adjust(sd->container, &dx, &dy);
+
+ Eina_Bool container_scrolled;
+ container_scrolled = _elm_smart_webview_container_scroll_adjust(sd->container, &dx, &dy);
if (dx == 0 && dy == 0)
{
sd->pan_s = *point;
_text_selection_move_by(sd, old_x - new_x, old_y - new_y);
#ifdef BOUNCING_SUPPORT
+ printf("<< ========content [%d, %d] old pos [%d, %d] new pos [%d, %d] >>(remained(%d, %d)\n",
+ content_w, content_h,
+ old_x, old_y,
+ old_x + dx, old_y + dy,
+ old_x + dx - new_x, old_y + dy - new_y);
int bx, by;
bx = old_x + dx - new_x;
by = old_y + dy - new_y;
- if (sd->on_flick && (bx != 0 || by != 0))
- {
- _elm_smart_webview_container_decelerated_flick_get(sd->container, &bx, &by);
- }
- _elm_smart_webview_container_bounce_add(sd->container, bx, by);
+ if (container_scrolled == EINA_TRUE || (bx != 0 || by != 0))
+ _elm_smart_webview_container_bounce_add(sd->container, bx, by);
#endif
#if 0 // comment out below code until it is completed
Eina_Bool
_elm_smart_webview_container_scroll_adjust(Evas_Object *obj, int *dx, int *dy)
{
- API_ENTRY return;
+ API_ENTRY return EINA_FALSE;
Eina_Bool changed = EINA_FALSE;
- printf(" [ WCSA ] %d , %d vs %d, %d\n", *dx, *dy, sd->bx, sd->by);
+ //printf(" [ WCSA ] %d , %d vs %d, %d\n", *dx, *dy, sd->bx, sd->by);
- if (sd->bx != 0)
+ if (sd->bx != 0 && *dx != 0)
{
int xsum = sd->bx + *dx;
if ((*dx < 0 && sd->bx > 0 && xsum < 0) ||
sd->bx = xsum;
*dx = 0;
}
+ changed = EINA_TRUE;
}
- if (sd->by != 0)
+ if (sd->by != 0 && *dy != 0)
{
int ysum = sd->by + *dy;
if ((*dy < 0 && sd->by > 0 && ysum < 0) ||
sd->by = ysum;
*dy = 0;
}
+ changed = EINA_TRUE;
}
#if 0
if (sd->bx > 0 && *dx < 0)
changed = EINA_TRUE;
}
#endif
- printf(" [ WCSA(A) ] %d , %d vs %d, %d\n", *dx, *dy, sd->bx, sd->by);
+ //printf(" [ WCSA(A) ] %d , %d vs %d, %d\n", *dx, *dy, sd->bx, sd->by);
return changed;
}
_smart_reconfigure(Smart_Data *sd)
{
evas_object_move(sd->child_obj, sd->x - sd->bx, sd->y - sd->by);
- //evas_object_move(sd->child_obj, sd->x, sd->y);
}
static void