On Wed, Dec 7, 2011 at 9:28 AM, zeljko <zel...@holobit.net> wrote: > Note that xxx_boundingRect() functions of qt are marked as slow (I guess > it's case when you deal with eg 1000 rects in region and you must calculate > lower TopLeft and high BottomRight) in their docs, I hope that we'll have > faster ones :)
Regions with thousands of rectangles look something extremely exotic to me, unless qt regions work internally by reducing all regions to a series of rectangles. But we will have real poligonal regions implemented, which allow for arbitrary paths via a transformation. I already use this for drawing poligons in TLazCanvas, so we already have IsPointInRegion for poligons implemented according to: http://www.visibone.com/inpoly/inpoly.c.txt http://www.visibone.com/inpoly/ So we can reduce all regions to a small amount of poligons. I never measured to know if IsPointInRegion is faster via 100s of rectangles or via poligon, but unless via poligons is dramatically slower I would definitively not want to change into the 100s of rectangles way. -- Felipe Monteiro de Carvalho _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel