/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// we need a graphics if ( !mpGraphics && !AcquireGraphics() ) return;
assert(mpGraphics);
if ( mbInitClipRegion )
InitClipRegion();
if ( mbOutputClipped ) return;
if ( mbInitLineColor )
InitLineColor();
if ( mbInitFillColor )
InitFillColor();
// use b2dpolygon drawing if possible if (RasterOp::OverPaint == GetRasterOp() && (IsLineColor() || IsFillColor()))
{ const basegfx::B2DHomMatrix aTransform(ImplGetDeviceTransformation());
basegfx::B2DPolyPolygon aB2DPolyPolygon(rPolyPoly.getB2DPolyPolygon());
// ensure closed - may be asserted, will prevent buffering if(!aB2DPolyPolygon.isClosed())
{
aB2DPolyPolygon.setClosed(true);
}
if (IsFillColor())
{
mpGraphics->DrawPolyPolygon(
aTransform,
aB2DPolyPolygon,
0.0,
*this);
}
bool bSuccess(true); if (IsLineColor())
{ constbool bPixelSnapHairline(mnAntialiasing & AntialiasingFlags::PixelSnapHairline);
for(autoconst& rPolygon : std::as_const(aB2DPolyPolygon))
{
bSuccess = mpGraphics->DrawPolyLine(
aTransform,
rPolygon,
0.0,
0.0, // tdf#124848 hairline
nullptr, // MM01
basegfx::B2DLineJoin::NONE,
css::drawing::LineCap_BUTT,
basegfx::deg2rad(15.0), // not used with B2DLineJoin::NONE, but the correct default
bPixelSnapHairline,
*this); if (!bSuccess) break;
}
}
// we need a graphics if ( !mpGraphics && !AcquireGraphics() ) return;
assert(mpGraphics);
if ( mbInitClipRegion )
InitClipRegion();
if ( mbOutputClipped ) return;
if ( mbInitLineColor )
InitLineColor();
if ( mbInitFillColor )
InitFillColor();
// use b2dpolygon drawing if possible if (RasterOp::OverPaint == GetRasterOp() && (IsLineColor() || IsFillColor()))
{ const basegfx::B2DHomMatrix aTransform(ImplGetDeviceTransformation());
basegfx::B2DPolygon aB2DPolygon(rPoly.getB2DPolygon());
// Caution: This method is nearly the same as // OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, double fTransparency), // so when changes are made here do not forget to make changes there, too
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.