当前位置: 首页>>代码示例>>C++>>正文


C++ SVGEllipseElement::get_ry方法代码示例

本文整理汇总了C++中SVGEllipseElement::get_ry方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGEllipseElement::get_ry方法的具体用法?C++ SVGEllipseElement::get_ry怎么用?C++ SVGEllipseElement::get_ry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SVGEllipseElement的用法示例。


在下文中一共展示了SVGEllipseElement::get_ry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CalculateBounds

//virtual
void PSVGEllipseElement::CalculateBounds()
{
	SVGEllipseElement* psvgElement = static_cast<SVGEllipseElement*>(m_pNode);

	gm::Matrix3d* matrix = psvgElement->transform_attr()->m_animVal->consolidateToMatrix();

	PSVGElement* pViewportElement = GetViewportElement();
	ASSERT(pViewportElement);

	gm::RectD viewBox = pViewportElement->GetViewBox();

	/*
	SVGLength* cxLength = psvgElement->m_cx->m_animated->m_animVal->m_value;
	SVGLength* cyLength = psvgElement->m_cy->m_animated->m_animVal->m_value;
	SVGLength* rxLength = psvgElement->m_rx->m_animated->m_animVal->m_value;
	SVGLength* ryLength = psvgElement->m_ry->m_animated->m_animVal->m_value;
	*/

	ISVGLength* cxLength = psvgElement->get_cx()->get_animVal();
	ISVGLength* cyLength = psvgElement->get_cy()->get_animVal();
	ISVGLength* rxLength = psvgElement->get_rx()->get_animVal();
	ISVGLength* ryLength = psvgElement->get_ry()->get_animVal();

	m_computedCx = LengthToUserUnits(cxLength, viewBox.Width);
	m_computedCy = LengthToUserUnits(cyLength, viewBox.Height);
	m_computedRx = LengthToUserUnits(rxLength, viewBox.Width);
	m_computedRy = LengthToUserUnits(ryLength, viewBox.Height);

	/*
	if (cxLength->m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
	{
		m_computedCx = (cxLength->m_valueInSpecifiedUnits * viewBox.Width)/100;
	}
	else
	{
		m_computedCx = cxLength->m_value;
	}

	if (cyLength->m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
	{
		m_computedCy = (cyLength->m_valueInSpecifiedUnits * viewBox.Height)/100;
	}
	else
	{
		m_computedCy = cyLength->m_value;
	}

	if (rxLength->m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
	{
		m_computedRx = (rxLength->m_valueInSpecifiedUnits * viewBox.Width)/100;
	}
	else
	{
		m_computedRx = rxLength->m_value;
	}

	if (ryLength->m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
	{
		m_computedRy = (ryLength->m_valueInSpecifiedUnits * viewBox.Height)/100;
	}
	else
	{
		m_computedRy = ryLength->m_value;
	}
	*/

	m_bounds.X = m_computedCx - m_computedRx;
	m_bounds.Y = m_computedCy - m_computedRy;
	m_bounds.Width = m_computedRx * 2;
	m_bounds.Height = m_computedRy * 2;

	m_xbounds = gm::CalcEllipseBBox(m_bounds.X, m_bounds.Y, m_bounds.Width, m_bounds.Height, matrix);

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

//	LDraw::Pen pen(LDraw::Color(0,0,0), (float)m_computedStrokeWidth);

	/*
	LDraw::RectF bounds;
	GraphicsPathF.GetBounds(&bounds, NULL, &pen);
	*/
	m_expandedBBox.X = m_bounds.X - m_computedStrokeWidth/2;
	m_expandedBBox.Y = m_bounds.Y - m_computedStrokeWidth/2;
	m_expandedBBox.Width = m_bounds.Width + m_computedStrokeWidth;
	m_expandedBBox.Height = m_bounds.Height + m_computedStrokeWidth;
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:88,代码来源:PSVGEllipseElement.cpp


注:本文中的SVGEllipseElement::get_ry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。