add translate functions for B2D*Polygon
Change-Id: I1f9091c47f0145d6fa0a8bc2deb4864244aad896 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183309 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
This commit is contained in:
@@ -176,6 +176,14 @@ public:
|
||||
point *= rMatrix;
|
||||
}
|
||||
}
|
||||
|
||||
void translate(double fTranslateX, double fTranslateY)
|
||||
{
|
||||
for (auto& point : maVector)
|
||||
{
|
||||
point += basegfx::B2DPoint(fTranslateX, fTranslateY);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class ControlVectorPair2D
|
||||
@@ -1092,6 +1100,28 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void translate(double fTranslateX, double fTranslateY)
|
||||
{
|
||||
mpBufferedData.reset();
|
||||
|
||||
if(moControlVector)
|
||||
{
|
||||
for(sal_uInt32 a(0); a < maPoints.count(); a++)
|
||||
{
|
||||
basegfx::B2DPoint aCandidate = maPoints.getCoordinate(a);
|
||||
aCandidate += basegfx::B2DPoint(fTranslateX, fTranslateY);
|
||||
maPoints.setCoordinate(a, aCandidate);
|
||||
}
|
||||
|
||||
if(!moControlVector->isUsed())
|
||||
moControlVector.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
maPoints.translate(fTranslateX, fTranslateY);
|
||||
}
|
||||
}
|
||||
|
||||
void addOrReplaceSystemDependentData(basegfx::SystemDependentData_SharedPtr& rData) const
|
||||
{
|
||||
if(!mpBufferedData)
|
||||
@@ -1480,6 +1510,14 @@ namespace basegfx
|
||||
}
|
||||
}
|
||||
|
||||
void B2DPolygon::translate(double fTranslateX, double fTranslateY)
|
||||
{
|
||||
if(count())
|
||||
{
|
||||
mpPolygon->translate(fTranslateX, fTranslateY);
|
||||
}
|
||||
}
|
||||
|
||||
void B2DPolygon::addOrReplaceSystemDependentDataInternal(SystemDependentData_SharedPtr& rData) const
|
||||
{
|
||||
mpPolygon->addOrReplaceSystemDependentData(rData);
|
||||
|
||||
@@ -177,6 +177,12 @@ public:
|
||||
aPolygon.transform(rMatrix);
|
||||
}
|
||||
|
||||
void translate(double fTranslateX, double fTranslateY)
|
||||
{
|
||||
for (auto& aPolygon : maPolygons)
|
||||
aPolygon.translate(fTranslateX, fTranslateY);
|
||||
}
|
||||
|
||||
void makeUnique()
|
||||
{
|
||||
for (auto& aPolygon : maPolygons)
|
||||
@@ -397,6 +403,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void B2DPolyPolygon::translate(double fTranslateX, double fTranslateY)
|
||||
{
|
||||
if(count())
|
||||
{
|
||||
mpPolyPolygon->translate(fTranslateX, fTranslateY);
|
||||
}
|
||||
}
|
||||
|
||||
const B2DPolygon* B2DPolyPolygon::begin() const
|
||||
{
|
||||
return mpPolyPolygon->begin();
|
||||
|
||||
@@ -113,8 +113,7 @@ namespace basegfx::unotools
|
||||
|
||||
if( !aOffset.equalZero() )
|
||||
{
|
||||
const B2DHomMatrix aTranslate(utils::createTranslateB2DHomMatrix(aOffset));
|
||||
aSrcPoly.transform( aTranslate );
|
||||
aSrcPoly.translate( aOffset );
|
||||
}
|
||||
|
||||
maPolyPoly.append( aSrcPoly );
|
||||
|
||||
@@ -368,7 +368,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void)
|
||||
basegfx::B2DRange aNewRange(basegfx::utils::getRange(aNewPolyPolygon));
|
||||
|
||||
// normalize
|
||||
aNewPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix( -aNewRange.getMinX(), -aNewRange.getMinY()));
|
||||
aNewPolyPolygon.translate( -aNewRange.getMinX(), -aNewRange.getMinY() );
|
||||
|
||||
pConvPolyObj.clear();
|
||||
|
||||
|
||||
@@ -914,7 +914,7 @@ namespace drawinglayer::primitive2d
|
||||
{
|
||||
basegfx::B2DPolygon aNew(aPolygon);
|
||||
|
||||
aNew.transform(basegfx::utils::createTranslateB2DHomMatrix(fDelta * fUnitScale, 0.0));
|
||||
aNew.translate(fDelta * fUnitScale, 0.0);
|
||||
aContainer[a] = new PolyPolygonColorPrimitive2D(
|
||||
basegfx::B2DPolyPolygon(aNew),
|
||||
basegfx::interpolate(getColorA(), getColorB(), fUnitScale));
|
||||
|
||||
@@ -2337,14 +2337,12 @@ namespace wmfemfhelper
|
||||
// prepare translation, add current transformation
|
||||
basegfx::B2DVector aVector(pA->GetHorzMove(), pA->GetVertMove());
|
||||
aVector *= rPropertyHolders.Current().getTransformation();
|
||||
basegfx::B2DHomMatrix aTransform(
|
||||
basegfx::utils::createTranslateB2DHomMatrix(aVector));
|
||||
|
||||
// transform existing region
|
||||
basegfx::B2DPolyPolygon aClipPolyPolygon(
|
||||
rPropertyHolders.Current().getClipPolyPolygon());
|
||||
|
||||
aClipPolyPolygon.transform(aTransform);
|
||||
aClipPolyPolygon.translate(aVector);
|
||||
HandleNewClipRegion(aClipPolyPolygon, rTargetHolders, rPropertyHolders);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,6 +226,10 @@ namespace basegfx
|
||||
/// apply transformation given in matrix form
|
||||
void transform(const basegfx::B2DHomMatrix& rMatrix);
|
||||
|
||||
/** Translate (ie. move).
|
||||
Much faster equivalent of transform(createTranslateB2DHomMatrix(xx)). */
|
||||
void translate(double fTranslateX, double fTranslateY);
|
||||
|
||||
// exclusive management op's for SystemDependentData at B2DPolygon
|
||||
template<class T>
|
||||
std::shared_ptr<T> getSystemDependentData(basegfx::SDD_Type aType) const
|
||||
|
||||
@@ -113,6 +113,15 @@ namespace basegfx
|
||||
// apply transformation given in matrix form to the polygon
|
||||
void transform(const basegfx::B2DHomMatrix& rMatrix);
|
||||
|
||||
/** Translate (ie. move).
|
||||
Much faster equivalent of transform(createTranslateB2DHomMatrix(xx)). */
|
||||
void translate(double fTranslateX, double fTranslateY);
|
||||
|
||||
inline void translate(const B2DTuple& rTranslate)
|
||||
{
|
||||
translate(rTranslate.getX(), rTranslate.getY());
|
||||
}
|
||||
|
||||
// polygon iterators (same iterator validity conditions as for vector)
|
||||
const B2DPolygon* begin() const;
|
||||
const B2DPolygon* end() const;
|
||||
|
||||
@@ -1590,7 +1590,7 @@ void CustomAnimationEffect::updateSdrPathObjFromPath( SdrPathObj& rPathObj )
|
||||
|
||||
const ::tools::Rectangle aBoundRect( pObj->GetCurrentBoundRect() );
|
||||
const Point aCenter( aBoundRect.Center() );
|
||||
aPolyPoly.transform(basegfx::utils::createTranslateB2DHomMatrix(aCenter.X(), aCenter.Y()));
|
||||
aPolyPoly.translate(aCenter.X(), aCenter.Y());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1620,7 +1620,7 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj
|
||||
|
||||
const Point aCenter( aBoundRect.Center() );
|
||||
|
||||
aPolyPoly.transform(basegfx::utils::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y()));
|
||||
aPolyPoly.translate(-aCenter.X(), -aCenter.Y());
|
||||
|
||||
SdrPage* pPage = pObj->getSdrPageFromSdrObject();
|
||||
if( pPage )
|
||||
|
||||
@@ -879,9 +879,7 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList )
|
||||
aPos = mxOrigin->getPosition();
|
||||
if( (aPos.X != maOriginPos.X) || (aPos.Y != maOriginPos.Y) )
|
||||
{
|
||||
const basegfx::B2DHomMatrix aTransform(basegfx::utils::createTranslateB2DHomMatrix(
|
||||
aPos.X - maOriginPos.X, aPos.Y - maOriginPos.Y));
|
||||
mxPolyPoly.transform( aTransform );
|
||||
mxPolyPoly.translate(aPos.X - maOriginPos.X, aPos.Y - maOriginPos.Y);
|
||||
mpPathObj->SetPathPoly( mxPolyPoly );
|
||||
maOriginPos = aPos;
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ void FuMorph::ImpMorphPolygons(
|
||||
const ::basegfx::B2DPoint aRealS(aStartCenter + (aDelta * fValue));
|
||||
const ::basegfx::B2DPoint aDiff(aRealS - aNewS);
|
||||
|
||||
aNewPolyPoly2D.transform(basegfx::utils::createTranslateB2DHomMatrix(aDiff));
|
||||
aNewPolyPoly2D.translate(aDiff);
|
||||
rPolyPolyList3D.push_back( std::move(aNewPolyPoly2D) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,8 +64,7 @@ namespace slideshow::internal {
|
||||
square4.flip(); // flip direction
|
||||
res.append( square4 );
|
||||
|
||||
aTransform = basegfx::utils::createTranslateB2DHomMatrix(0.5, 0.5);
|
||||
res.transform( aTransform );
|
||||
res.translate( 0.5, 0.5 );
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ RandomWipe::RandomWipe( sal_Int32 nElements, bool randomBars )
|
||||
{
|
||||
::basegfx::B2DPoint const & point = m_positions[ pos ];
|
||||
::basegfx::B2DPolygon poly( m_rect );
|
||||
poly.transform(basegfx::utils::createTranslateB2DHomMatrix(point.getX(), point.getY()));
|
||||
poly.translate(point.getX(), point.getY());
|
||||
res.append( poly );
|
||||
}
|
||||
return res;
|
||||
|
||||
@@ -40,8 +40,7 @@ namespace slideshow::internal {
|
||||
|
||||
if (m_center)
|
||||
{
|
||||
aTransform = basegfx::utils::createTranslateB2DHomMatrix(0.5, 0.0);
|
||||
poly.transform( aTransform );
|
||||
poly.translate( 0.5, 0.0 );
|
||||
}
|
||||
::basegfx::B2DPolyPolygon res(poly);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ WaterfallWipe::WaterfallWipe( sal_Int32 nElements, bool flipOnYAxis )
|
||||
::basegfx::B2DPolyPolygon WaterfallWipe::operator () ( double t )
|
||||
{
|
||||
::basegfx::B2DPolygon poly( m_waterfall );
|
||||
poly.transform(basegfx::utils::createTranslateB2DHomMatrix(0.0, ::basegfx::pruneScaleValue(2.0 * t)));
|
||||
poly.translate(0.0, ::basegfx::pruneScaleValue(2.0 * t));
|
||||
poly.setB2DPoint( 0, ::basegfx::B2DPoint( 0.0, -1.0 ) );
|
||||
poly.setB2DPoint( poly.count()-1, ::basegfx::B2DPoint( 1.0, -1.0 ) );
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ ZigZagWipe::ZigZagWipe( sal_Int32 nZigs ) : m_zigEdge( 1.0 / nZigs )
|
||||
::basegfx::B2DPolyPolygon ZigZagWipe::operator () ( double t )
|
||||
{
|
||||
::basegfx::B2DPolyPolygon res(m_stdZigZag);
|
||||
res.transform(basegfx::utils::createTranslateB2DHomMatrix((1.0 + m_zigEdge) * t, 0.0));
|
||||
res.translate((1.0 + m_zigEdge) * t, 0.0);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -2471,8 +2471,7 @@ void EnhancedCustomShape2d::CreateSubPath(
|
||||
basegfx::B2DPoint aCurrentPointB2D( aNewB2DPolygon.getB2DPoint(aNewB2DPolygon.count() - 1 ) );
|
||||
const double fDx(aCurrentPointB2D.getX() - aTempB2DPolygon.getB2DPoint(0).getX());
|
||||
const double fDy(aCurrentPointB2D.getY() - aTempB2DPolygon.getB2DPoint(0).getY());
|
||||
aMatrix = basegfx::utils::createTranslateB2DHomMatrix(fDx, fDy);
|
||||
aTempB2DPolygon.transform(aMatrix);
|
||||
aTempB2DPolygon.translate(fDx, fDy);
|
||||
aNewB2DPolygon.append(aTempB2DPolygon);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,8 +154,7 @@ namespace sdr::contact
|
||||
|
||||
// create shadow outline
|
||||
basegfx::B2DPolygon aShadowOutline(aObjectOutline);
|
||||
aShadowOutline.transform(
|
||||
basegfx::utils::createTranslateB2DHomMatrix(nXDist, nYDist));
|
||||
aShadowOutline.translate(nXDist, nYDist);
|
||||
|
||||
// clip shadow outline against object outline
|
||||
const basegfx::B2DPolyPolygon aClippedShadow(
|
||||
|
||||
@@ -2262,7 +2262,7 @@ PointerStyle SdrPathObj::GetCreatePointer() const
|
||||
|
||||
void SdrPathObj::NbcMove(const Size& rSiz)
|
||||
{
|
||||
maPathPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(rSiz.Width(), rSiz.Height()));
|
||||
maPathPolygon.translate(rSiz.Width(), rSiz.Height());
|
||||
|
||||
// #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
|
||||
SdrTextObj::NbcMove(rSiz);
|
||||
|
||||
@@ -858,8 +858,7 @@ void SdrTextObj::impDecomposeContourTextPrimitive(
|
||||
aPolyPolygon.transform(aRemoveRotShear);
|
||||
// Move Top/Left to origin
|
||||
basegfx::B2DRange aBoundRange = aPolyPolygon.getB2DRange();
|
||||
aPolyPolygon.transform(
|
||||
basegfx::utils::createTranslateB2DHomMatrix(-aBoundRange.getMinimum()));
|
||||
aPolyPolygon.translate(-aBoundRange.getMinimum());
|
||||
|
||||
// Calculate the translation needed to bring the text to the original position of
|
||||
// aPolyPolygon.
|
||||
|
||||
@@ -239,7 +239,7 @@ basegfx::B2DPolyPolygon SdrVirtObj::TakeXorPoly() const
|
||||
|
||||
if(m_aAnchor.X() || m_aAnchor.Y())
|
||||
{
|
||||
aPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(m_aAnchor.X(), m_aAnchor.Y()));
|
||||
aPolyPolygon.translate(m_aAnchor.X(), m_aAnchor.Y());
|
||||
}
|
||||
|
||||
return aPolyPolygon;
|
||||
|
||||
@@ -2207,7 +2207,7 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertyMapEn
|
||||
if( pSdrObject->getSdrModelFromSdrObject().IsWriter() )
|
||||
{
|
||||
Point aPoint( pSdrObject->GetAnchorPos() );
|
||||
aNewPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(aPoint.X(), aPoint.Y()));
|
||||
aNewPolyPolygon.translate(aPoint.X(), aPoint.Y());
|
||||
}
|
||||
pEdgeObj->SetEdgeTrackPath( aNewPolyPolygon );
|
||||
return true;
|
||||
@@ -2744,7 +2744,7 @@ bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertyMapEn
|
||||
if( GetSdrObject()->getSdrModelFromSdrObject().IsWriter() )
|
||||
{
|
||||
Point aPoint( GetSdrObject()->GetAnchorPos() );
|
||||
aPolyPoly.transform(basegfx::utils::createTranslateB2DHomMatrix(-aPoint.X(), -aPoint.Y()));
|
||||
aPolyPoly.translate(-aPoint.X(), -aPoint.Y());
|
||||
}
|
||||
// Reintroduction of fix for issue #i59051# (#i108851#)
|
||||
ForceMetricTo100th_mm( aPolyPoly );
|
||||
|
||||
@@ -2508,7 +2508,7 @@ void SwDrawVirtObj::RecalcBoundRect()
|
||||
basegfx::B2DPolyPolygon SwDrawVirtObj::TakeXorPoly() const
|
||||
{
|
||||
basegfx::B2DPolyPolygon aRetval(mxRefObj->TakeXorPoly());
|
||||
aRetval.transform(basegfx::utils::createTranslateB2DHomMatrix(GetOffset().X(), GetOffset().Y()));
|
||||
aRetval.translate(GetOffset().X(), GetOffset().Y());
|
||||
|
||||
return aRetval;
|
||||
}
|
||||
@@ -2516,7 +2516,7 @@ basegfx::B2DPolyPolygon SwDrawVirtObj::TakeXorPoly() const
|
||||
basegfx::B2DPolyPolygon SwDrawVirtObj::TakeContour() const
|
||||
{
|
||||
basegfx::B2DPolyPolygon aRetval(mxRefObj->TakeContour());
|
||||
aRetval.transform(basegfx::utils::createTranslateB2DHomMatrix(GetOffset().X(), GetOffset().Y()));
|
||||
aRetval.translate(GetOffset().X(), GetOffset().Y());
|
||||
|
||||
return aRetval;
|
||||
}
|
||||
|
||||
@@ -2694,15 +2694,11 @@ css::drawing::PolyPolygonBezierCoords SwXShape::ConvertPolyPolygonBezierToLayout
|
||||
// apply translation difference to PolyPolygonBezier.
|
||||
if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
|
||||
{
|
||||
const basegfx::B2DHomMatrix aMatrix(basegfx::utils::createTranslateB2DHomMatrix(
|
||||
aTranslateDiff.X, aTranslateDiff.Y));
|
||||
|
||||
for(drawing::PointSequence& rInnerSequence : asNonConstRange(aConvertedPath.Coordinates))
|
||||
{
|
||||
for(awt::Point& rPoint : asNonConstRange(rInnerSequence))
|
||||
{
|
||||
basegfx::B2DPoint aNewCoordinatePair(rPoint.X, rPoint.Y);
|
||||
aNewCoordinatePair *= aMatrix;
|
||||
basegfx::B2DPoint aNewCoordinatePair(rPoint.X + aTranslateDiff.X, rPoint.Y + aTranslateDiff.Y);
|
||||
rPoint.X = basegfx::fround(aNewCoordinatePair.getX());
|
||||
rPoint.Y = basegfx::fround(aNewCoordinatePair.getY());
|
||||
}
|
||||
|
||||
@@ -332,9 +332,8 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj)
|
||||
|
||||
// Make relative to range 0..21600, 0..21600
|
||||
Point aCenter(pSdrObj->GetSnapRect().Center());
|
||||
basegfx::B2DHomMatrix aTranslateToOrigin(
|
||||
basegfx::utils::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y()));
|
||||
aPolyPolygon.transform(aTranslateToOrigin);
|
||||
// translate to origin
|
||||
aPolyPolygon.translate(-aCenter.X(), -aCenter.Y());
|
||||
const double fWidth(pSdrObj->GetLogicRect().getOpenWidth());
|
||||
double fScaleX = fWidth == 0.0 ? 1.0 : 21600.0 / fWidth;
|
||||
const double fHeight(pSdrObj->GetLogicRect().getOpenHeight());
|
||||
@@ -342,9 +341,8 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj)
|
||||
basegfx::B2DHomMatrix aScale(basegfx::utils::createScaleB2DHomMatrix(fScaleX, fScaleY));
|
||||
aPolyPolygon.transform(aScale);
|
||||
|
||||
basegfx::B2DHomMatrix aTranslateToCenter(
|
||||
basegfx::utils::createTranslateB2DHomMatrix(10800.0, 10800.0));
|
||||
aPolyPolygon.transform(aTranslateToCenter);
|
||||
// translate to center
|
||||
aPolyPolygon.translate(10800.0, 10800.0);
|
||||
break;
|
||||
} // end case OBJ_CUSTOMSHAPE
|
||||
case SdrObjKind::Line:
|
||||
@@ -383,9 +381,8 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj)
|
||||
|
||||
// Make relative to range 0..21600, 0..21600
|
||||
Point aCenter(pSdrObj->GetSnapRect().Center());
|
||||
basegfx::B2DHomMatrix aTranslateToOrigin(
|
||||
basegfx::utils::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y()));
|
||||
aPolyPolygon.transform(aTranslateToOrigin);
|
||||
// translate to origin
|
||||
aPolyPolygon.translate(-aCenter.X(), -aCenter.Y());
|
||||
|
||||
const double fWidth(pSdrObj->GetLogicRect().getOpenWidth());
|
||||
double fScaleX = fWidth == 0.0 ? 1.0 : 21600.0 / fWidth;
|
||||
@@ -395,9 +392,7 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj)
|
||||
basegfx::utils::createScaleB2DHomMatrix(fScaleX, fScaleY));
|
||||
aPolyPolygon.transform(aScale);
|
||||
|
||||
basegfx::B2DHomMatrix aTranslateToCenter(
|
||||
basegfx::utils::createTranslateB2DHomMatrix(10800.0, 10800.0));
|
||||
aPolyPolygon.transform(aTranslateToCenter);
|
||||
aPolyPolygon.translate(10800.0, 10800.0);
|
||||
break;
|
||||
}
|
||||
case SdrObjKind::NONE:
|
||||
|
||||
@@ -1234,9 +1234,7 @@ void GraphicImport::lcl_attribute(Id nName, const Value& rValue)
|
||||
o3tl::convert(1.0, o3tl::Length::twip, o3tl::Length::mm100));
|
||||
aShapePolygon.transform(aMatrix);
|
||||
// Wrap polygon treats left/top of shape as origin, shift shape polygon accordingly
|
||||
aMatrix = basegfx::utils::createTranslateB2DHomMatrix(
|
||||
-aImportPosition.X, -aImportPosition.Y);
|
||||
aShapePolygon.transform(aMatrix);
|
||||
aShapePolygon.translate(-aImportPosition.X, -aImportPosition.Y);
|
||||
aShapeRange = aShapePolygon.getB2DRange();
|
||||
}
|
||||
else // can this happen?
|
||||
|
||||
@@ -307,9 +307,8 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics
|
||||
if (y > aSVGRect.getCenterY())
|
||||
y = y + fDeltaY;
|
||||
|
||||
aGradient.maPoint1 = basegfx::B2DPoint(x, y);
|
||||
aGradient.maPoint1 *= basegfx::utils::createTranslateB2DHomMatrix(
|
||||
aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5);
|
||||
aGradient.maPoint1 = basegfx::B2DPoint(x + aTargetSurface.getMinX() - 0.5,
|
||||
y + aTargetSurface.getMinY() - 0.5);
|
||||
|
||||
x = pLinearGradient->x2;
|
||||
y = pLinearGradient->y2;
|
||||
@@ -319,9 +318,8 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics
|
||||
if (y > aSVGRect.getCenterY())
|
||||
y = y + fDeltaY;
|
||||
|
||||
aGradient.maPoint2 = basegfx::B2DPoint(x, y);
|
||||
aGradient.maPoint2 *= basegfx::utils::createTranslateB2DHomMatrix(
|
||||
aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5);
|
||||
aGradient.maPoint2 = basegfx::B2DPoint(x + aTargetSurface.getMinX() - 0.5,
|
||||
y + aTargetSurface.getMinY() - 0.5);
|
||||
|
||||
for (gfx::GradientStop const& rStop : pLinearGradient->maGradientStops)
|
||||
{
|
||||
@@ -369,8 +367,8 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics
|
||||
rPolygon.setB2DPoint(i, basegfx::B2DPoint(x, y));
|
||||
}
|
||||
}
|
||||
aPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(
|
||||
aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5));
|
||||
aPolyPolygon.translate(aTargetSurface.getMinX() - 0.5,
|
||||
aTargetSurface.getMinY() - 0.5);
|
||||
|
||||
if (rPath.mpFillColor)
|
||||
{
|
||||
|
||||
@@ -357,10 +357,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource)
|
||||
|
||||
if((aHorMove || aVerMove) && !aClips.empty() && aClips.back().count())
|
||||
{
|
||||
aClips.back().transform(
|
||||
basegfx::utils::createTranslateB2DHomMatrix(
|
||||
aHorMove,
|
||||
aVerMove));
|
||||
aClips.back().translate(aHorMove, aVerMove);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ void vcl::Region::Move( tools::Long nHorzMove, tools::Long nVertMove )
|
||||
{
|
||||
basegfx::B2DPolyPolygon aPoly(*getB2DPolyPolygon());
|
||||
|
||||
aPoly.transform(basegfx::utils::createTranslateB2DHomMatrix(nHorzMove, nVertMove));
|
||||
aPoly.translate(nHorzMove, nVertMove);
|
||||
if (aPoly.count())
|
||||
mpB2DPolyPolygon = aPoly;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user