AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const { if (!m_useCurrentView || !m_viewSpec) return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), preserveAspectRatio(), viewWidth, viewHeight); AffineTransform transform = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), m_viewSpec->preserveAspectRatio(), viewWidth, viewHeight); m_viewSpec->transformBaseValue().concatenate(transform); return transform; }
AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const { if (!m_useCurrentView || !m_viewSpec) return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), preserveAspectRatio(), viewWidth, viewHeight); AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), m_viewSpec->preserveAspectRatio(), viewWidth, viewHeight); const SVGTransformList& transformList = m_viewSpec->transformBaseValue(); if (transformList.isEmpty()) return ctm; AffineTransform transform; if (transformList.concatenate(transform)) ctm *= transform; return ctm; }
AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const { AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), preserveAspectRatio(), viewWidth, viewHeight); if (useCurrentView() && currentView()) { AffineTransform transform; if (currentView()->transform().concatenate(transform)) ctm *= transform; } return ctm; }
AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const { AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform( currentViewBoxRect(), currentPreserveAspectRatio(), viewWidth, viewHeight); if (!m_viewSpec) return ctm; SVGTransformList* transformList = m_viewSpec->transform(); if (transformList->isEmpty()) return ctm; AffineTransform transform; if (transformList->concatenate(transform)) ctm *= transform; return ctm; }