Пример #1
0
static void TestOverflowHitTest() {
    SkPath path;

#ifdef SK_SCALAR_IS_FLOATx // FIXME: unclear when if ever this can be enabled
    path.addCircle(0, 0, 70000, SkPath::kCCW_Direction);
    SkASSERT(HitTestPath(path, 40000, 40000));
#endif
}
Пример #2
0
static void TestOverflowHitTest() {
    SkPath path;
    
#ifdef SK_SCALAR_IS_FLOATx
    path.addCircle(0, 0, 70000, SkPath::kCCW_Direction);
    SkASSERT(HitTestPath(path, 40000, 40000));
#endif
}
Пример #3
0
//virtual
bool PSVGEllipseElement::HitTest(double x, double y, int pointerEvents)
{
	SVGEllipseElement* psvgElement = static_cast<SVGEllipseElement*>(m_pNode);

	bool bOver = false;

	x -= m_computedCx;
	y -= m_computedCy;

	// Scale it into a circle
	x /= m_computedRx;
	y /= m_computedRy;

	if ((x*x + y*y) <= 1)
	{
		bOver = true;
	}

	return bOver;

#if 0
	/*
	CComObject<CLSVGPathSegList>* seglist;
	CComObject<CLSVGPathSegList>::CreateInstance(&seglist);
	if (seglist)
	{
		seglist->AddRef();

		seglist->AddEllipse(m_computedCx, m_computedCy, m_computedRx, m_computedRy);
		*/

		LDraw::GraphicsPathF GraphicsPathF;
	//	DrawPathSegList(seglist, &GraphicsPathF, NULL);
		GraphicsPathF.AddEllipse(float(m_bounds.X), float(m_bounds.Y), float(m_bounds.Width), float(m_bounds.Height));

		bOver = HitTestPath(this, &GraphicsPathF, x, y, pointerEvents);

		/*
		seglist->Release();
	}
	*/

	return bOver;
#endif
}
Пример #4
0
//virtual
bool PSVGPathElement::HitTest(double x, double y, int pointerEvents)
{
	SVGPathElement* psvgElement = static_cast<SVGPathElement*>(m_pNode);

	bool bOver = false;
#if 0

	SVGPathSegList* seglist = psvgElement->m_d->m_animated->m_animVal->m_value->m_normalizedseglist;

	if (seglist)
	{
		LDraw::GraphicsPathF GraphicsPathF(m_computedFillRule == FillRule_nonzero? LDraw::FillModeWinding: LDraw::FillModeAlternate);
		DrawPathSegList(seglist, &GraphicsPathF, NULL);

		bOver = HitTestPath(this, &GraphicsPathF, x, y, pointerEvents);
	}
#endif
	return bOver;
}