Dear Tom, Thanks for reply.
In your assumption, do you mean that ww have to keep 50 ? But in my patch, I just save the value wx, wy. Is It related to ww? I want to explain the wierd situation.(It occur actually in application) Let assume we have a child 200x800 and viewport 200x200. At first, wx,wy is 0,0. If we drag down the scroller 100 pixel and do mouse-up, wx,wy will be 0,-100. And the scroller go back 0/0 because of bouncing. We see 0,0 but wx wy is 0,-100. In this situation, if the resizing of the scroller occur, it call elm_smart_scroller_child_region_set(obj, 0, -100, ...). Then the scroller go to 0,-100 in a moment and back 0,0. It seem to bounce automatically. If the saving wx,wy in the "elm_smart_scroller_child_pos_set" is not correct, do you have any idea for solving above bug? If I'm misunderstanding, please let me know. Thanks, Jaehwan Kim ------- Original Message ------- Sender : Tom Hacohen Engineer/STRI-SLP RTL Language supporting/삼성전자 Date : 2011-02-10 18:00 (GMT+09:00) Title : Re: [E-devel] E SVN: tasn trunk/TMP/st/elementary/src/lib Dear Jae Hwan, Thanks for the report. I disagree with your change, and I will explain why (I guess the code needs more docs). wx and wy are the "wanted x and y" i.e the last position the user asked for (user being either an actual scroll, or a region show for example). This is used for moving the scroller on widget resizes and the such and fixes a couple of nasty bugs as well. I'm aware there's still an open issue with this one. Momentum scrolling does not work at the moment, but I shoved this fix anyway because it was better than before. Setting wx and wy in elm_smart_scroller_child_pos_set mean the features above will not work, because you can't tell if it was an internal move (i.e because of size constraints) or a wanted move (because of a user scroll). Best test case to explain the issue with your suggestion: (I omit the y and h in the explanation below just to make things simpler, but it applies on those as well). Lets assume we have a child with a width of 200 and a viewport with a width of 50. we want to show the the rightmost part of the scroller so we call region_show(x=150, w=50) on the scroller (we got there by scrolling) wx is now 150 and ww is 50. now consider we resize the viewport to be 25, it will not scroll but only set wx to 150 and ww to 25. Now, when we resize the viewport to be 50 again, we won't get 150/50 but will scroll to 150/25 and thus we'll see 125-175. If you are saying I updated wx/wy incorrectly (in mouse up) that's a whole different story, and if that's the case, please elaborate. Thanks, Tom. -----Original Message----- From: Tom Hacohen [mailto:tom.haco...@partner.samsung.com] Sent: Thursday, February 10, 2011 6:00 PM To: jae.hwan....@samsung.com Cc: enlightenment-devel@lists.sourceforge.net; t...@stosb.com Subject: Re: [E-devel] E SVN: tasn trunk/TMP/st/elementary/src/lib Dear Jae Hwan, Thanks for the report. I disagree with your change, and I will explain why (I guess the code needs more docs). wx and wy are the "wanted x and y" i.e the last position the user asked for (user being either an actual scroll, or a region show for example). This is used for moving the scroller on widget resizes and the such and fixes a couple of nasty bugs as well. I'm aware there's still an open issue with this one. Momentum scrolling does not work at the moment, but I shoved this fix anyway because it was better than before. Setting wx and wy in elm_smart_scroller_child_pos_set mean the features above will not work, because you can't tell if it was an internal move (i.e because of size constraints) or a wanted move (because of a user scroll). Best test case to explain the issue with your suggestion: (I omit the y and h in the explanation below just to make things simpler, but it applies on those as well). Lets assume we have a child with a width of 200 and a viewport with a width of 50. we want to show the the rightmost part of the scroller so we call region_show(x=150, w=50) on the scroller (we got there by scrolling) wx is now 150 and ww is 50. now consider we resize the viewport to be 25, it will not scroll but only set wx to 150 and ww to 25. Now, when we resize the viewport to be 50 again, we won't get 150/50 but will scroll to 150/25 and thus we'll see 125-175. If you are saying I updated wx/wy incorrectly (in mouse up) that's a whole different story, and if that's the case, please elaborate. Thanks, Tom. On Thu, 2011-02-10 at 08:45 +0000, Jae Hwan Kim wrote: > > Hello > I found a bug in the els_scroller. > Tasn inserted the variable (wx, wy, ww, wh) which are the members of the > Smart_Data. > And they are used in the function "_smart_resize". > They are set in the functions "_smart_event_mouse_up", > "smart_event_mouse_down" and so on. > In case of dragging down and mouse-up, the function "_smart_event_mouse_up" > is called > and wx, wy save the position where mouse-up event occured. > Since the position is minus, the scroller come back to the zero position. > But wx, wy are not changed. > In this situation, if "_smart_resize" is called, the scroller will move to > the position wx, wy. > It is not the expected action. > > I think that wx, wy should save the last position of the scroller. > > Please check following patch. > Thanks. > Index: src/lib/els_scroller.c > =================================================================== > --- src/lib/els_scroller.c (revision 56892) > +++ src/lib/els_scroller.c (work copy) > @@ -918,6 +918,8 @@ elm_smart_scroller_child_pos_set(Evas_Object *obj, > } > sd->pan_func.set(sd->pan_obj, x, y); > + sd->wx = x; > + sd->wy = y; > if ((px != x) || (py != y)) > edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); > if (!sd->down.bounce_x_animator) > > > > ------- Original Message ------- > From: Enlightenment SVN > Date: Mon, Jan 24, 2011 at 7:50 PM > Subject: E SVN: tasn trunk/TMP/st/elementary/src/lib > To: enlightenment-...@lists.sourceforge.net > Log: > Elementary: Wrote proper support for "wanted position" in > els_scroller. It will now save the position we really wanted to get to > (for example because of scrolling) and will go back to that place > after resizes. Fixes a couple of bugs. > In this change I also introduced elm_smart_scroller_child_region_set > thats used to change the position of the scroller, without actually > saving it as a wanted position. > Author: tasn > Date: 2011-01-24 02:50:35 -0800 (Mon, 24 Jan 2011) > New Revision: 56284 > Trac: http://trac.enlightenment.org/e/changeset/56284 > Modified: > trunk/TMP/st/elementary/src/lib/els_scroller.c > trunk/TMP/st/elementary/src/lib/els_scroller.h > Modified: trunk/TMP/st/elementary/src/lib/els_scroller.c > =================================================================== > --- trunk/TMP/st/elementary/src/lib/els_scroller.c 2011-01-24 > 10:50:33 UTC (rev 56283) > +++ trunk/TMP/st/elementary/src/lib/els_scroller.c 2011-01-24 > 10:50:35 UTC (rev 56284) > @@ -12,6 +12,7 @@ > struct _Smart_Data > { > Evas_Coord x, y, w, h; > + Evas_Coord wx, wy, ww, wh; /* Last "wanted" geometry */ > Evas_Object *smart_obj; > Evas_Object *child_obj; > @@ -165,6 +166,7 @@ > } > sd->child_obj = child; > + sd->wx = sd->wy = sd->ww = sd->wh = 0; > if (!child) return; > if (!sd->pan_obj) > @@ -400,7 +402,7 @@ > elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); > elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h); > x = pos_x; > - elm_smart_scroller_child_region_show(sd->smart_obj, x, y, w, h); > + elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h); > return; > } > t = ecore_loop_time_get(); > @@ -411,7 +413,7 @@ > sd->scrollto.x.t_end = t + t_in; > elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); > elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h); > - elm_smart_scroller_child_region_show(sd->smart_obj, x, y, w, h); > + elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h); > if (!sd->scrollto.x.animator) > { > if (!sd->scrollto.y.animator) > @@ -467,7 +469,7 @@ > elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); > elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h); > y = pos_y; > - elm_smart_scroller_child_region_show(sd->smart_obj, x, y, w, h); > + elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h); > return; > } > t = ecore_loop_time_get(); > @@ -478,7 +480,7 @@ > sd->scrollto.y.t_end = t + t_in; > elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); > elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h); > - elm_smart_scroller_child_region_show(sd->smart_obj, x, y, w, h); > + elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h); > if (!sd->scrollto.y.animator) > { > if (!sd->scrollto.x.animator) > @@ -573,7 +575,7 @@ > x = _smart_page_x_get(sd, 0); > y = _smart_page_y_get(sd, 0); > - elm_smart_scroller_child_region_show(sd->smart_obj, x, y, w, h); > + elm_smart_scroller_child_region_set(sd->smart_obj, x, y, w, h); > } > static Eina_Bool > @@ -916,8 +918,10 @@ > sd->pan_func.get(sd->pan_obj, x, y); > } > -void > -elm_smart_scroller_child_region_show(Evas_Object *obj, Evas_Coord x, > Evas_Coord y, Evas_Coord w, Evas_Coord h) > +/* "internal_call" actually toggles whether we should save the coords and > do > + * extra "speedup" checks, or not. */ > +static void > +_elm_smart_scroller_child_region_show_internal(Evas_Object *obj, > Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool > internal_call) > { > Evas_Coord mx = 0, my = 0, cw = 0, ch = 0, px = 0, py = 0, nx, ny, > minx = 0, miny = 0; > @@ -941,7 +945,15 @@ > ny = y + h - (ch - my); > if (ny > y) ny = y; > } > - if ((nx == px) && (ny == py)) return; > + if (!internal_call) > + { > + sd->wx = x; > + sd->wy = y; > + sd->ww = w; > + sd->wh = h; > + if ((nx == px) && (ny == py)) return; > + } > + > if ((sd->down.bounce_x_animator) || (sd->down.bounce_y_animator) || > (sd->scrollto.x.animator) || (sd->scrollto.y.animator)) > { > @@ -989,7 +1001,24 @@ > elm_smart_scroller_child_pos_set(obj, nx, ny); > } > +/* Set should be used for calculated positions, for example, when we move > + * because of an animation or because this is the correct position after > + * constraints. */ > void > +elm_smart_scroller_child_region_set(Evas_Object *obj, Evas_Coord x, > Evas_Coord y, Evas_Coord w, Evas_Coord h) > +{ > + _elm_smart_scroller_child_region_show_internal(obj, x, y, w, h, > EINA_TRUE); > +} > + > +/* Set should be used for setting the wanted position, for example a > user scroll > + * or moving the cursor in an entry. */ > +void > +elm_smart_scroller_child_region_show(Evas_Object *obj, Evas_Coord x, > Evas_Coord y, Evas_Coord w, Evas_Coord h) > +{ > + _elm_smart_scroller_child_region_show_internal(obj, x, y, w, h, > EINA_FALSE); > +} > + > +void > elm_smart_scroller_child_viewport_size_get(Evas_Object *obj, > Evas_Coord *w, Evas_Coord *h) > { > API_ENTRY return; > @@ -1438,7 +1467,11 @@ > x += ev->z * sd->step.x; > if ((!sd->hold) && (!sd->freeze)) > - elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); > + { > + sd->wx = x; > + sd->wy = y; > + elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); > + } > } > static void > @@ -1551,6 +1584,8 @@ > } > } > elm_smart_scroller_child_pos_set(sd->smart_obj, ox, oy); > + sd->wx = ox; > + sd->wy = oy; > return ECORE_CALLBACK_RENEW; > } > @@ -1769,6 +1804,8 @@ > sd->down.now = 0; > elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); > elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); > + sd->wx = x; > + sd->wy = y; > if (!_smart_do_page(sd)) > bounce_eval(sd); > } > @@ -1817,6 +1854,8 @@ > } > elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); > + sd->wx = x; > + sd->wy = y; > // printf("scroll %i %i\n", sd->down.hold_x, sd->down.hold_y); > } > sd->down.onhold_tlast = t; > @@ -1906,6 +1945,8 @@ > #ifdef SCROLLDBG > printf("::: %i %i\n", ev->cur.canvas.x, ev->cur.canvas.y); > #endif > + sd->wx = ev->cur.canvas.x; > + sd->wy = ev->cur.canvas.y; > memmove(&(sd->down.history[1]), &(sd->down.history[0]), > sizeof(sd->down.history[0]) * 19); > #ifdef EVTIME > @@ -2494,6 +2535,7 @@ > sd->w = w; > sd->h = h; > _smart_reconfigure(sd); > + elm_smart_scroller_child_region_set(obj, sd->wx, sd->wy, sd->ww, > sd->h); > } > static void > Modified: trunk/TMP/st/elementary/src/lib/els_scroller.h > =================================================================== > --- trunk/TMP/st/elementary/src/lib/els_scroller.h 2011-01-24 > 10:50:33 UTC (rev 56283) > +++ trunk/TMP/st/elementary/src/lib/els_scroller.h 2011-01-24 > 10:50:35 UTC (rev 56284) > @@ -13,6 +13,7 @@ > void elm_smart_scroller_child_pos_set (Evas_Object *obj, > Evas_Coord x, Evas_Coord y); > void elm_smart_scroller_child_pos_get (Evas_Object *obj, > Evas_Coord *x, Evas_Coord *y); > void elm_smart_scroller_child_region_show (Evas_Object *obj, > Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); > +void elm_smart_scroller_child_region_set (Evas_Object *obj, > Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); > void elm_smart_scroller_child_viewport_size_get (Evas_Object *obj, > Evas_Coord *w, Evas_Coord *h); > void elm_smart_scroller_step_size_set (Evas_Object *obj, > Evas_Coord x, Evas_Coord y); > void elm_smart_scroller_step_size_get (Evas_Object *obj, > Evas_Coord *x, Evas_Coord *y); > > ---------------------------------------------------------------------------- > -- > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better > price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > > > > > [cid:EWXXYKENUIXH@namo.co.kr] > > > [SeenTimeChecker?do=764d2c50b23762c036aa737334649995cdb9a5e487a0e946b9d2a415 > > 8a55a362ba777c355c197185c465c2cf80a2b7ef9aba4bb3b2b5ca43ddd7e184e0604d958075 > b6b33f32d245b7f8aafe245478a5f1d21d5ebee74427cf878f9a26ce15a0] > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ enlightenment-devel mailing > list enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel