True, very true. Although not in every case. If parent is not visible then the cost of containsPt is - getParent - getParent's visibility (and it's false) -> you got the answer so two basic operations But finding whether view contains a point can be a tricky business (at least 4 comparisons and if we start considering rotation and other complex stuff) well then who knows...
The point I am trying to make here is this: traversing parents and checking only for boolean (visible) might be quite cheap compared to containsPt if it were to observe all view's attributes. However view hierarchies can be deep so PT has a point in here. - rami P T Withington kirjoitti: > Don't you want to first check that the view you start with contains > the point, before you start walking the parents? That would seem more > optimal. > > On 2009-09-03, at 15:31, Max Carlson wrote: > >> Change 20090901-maxcarlson-b by maxcarl...@bank on 2009-09-01 17:42:31 >> PDT >> in /Users/maxcarlson/openlaszlo/trunk-clean >> for http://svn.openlaszlo.org/openlaszlo/trunk >> >> Summary: Fix LzView.containsPt() to handle clipped and invisible items >> >> Bugs Fixed: LPP-8379 - mousetrack events act as if clip attribute >> would not exist >> >> Technical Reviewer: ptw >> QA Reviewer: [email protected] >> >> Details: LzTrack - Use LzView.containsPt() to determine if items >> should be tracked. >> >> LaszloView - Update containsPt() to check for invisible and masked >> parents' bounds. >> >> Tests: See LPP-8379. >> >> Files: >> M WEB-INF/lps/lfc/services/LzTrack.lzs >> M WEB-INF/lps/lfc/views/LaszloView.lzs >> >> Changeset: >> http://svn.openlaszlo.org/openlaszlo/patches/20090901-maxcarlson-b.tar >> _______________________________________________ >> Laszlo-reviews mailing list >> [email protected] >> http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews > _______________________________________________ Laszlo-reviews mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews
