tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / svx / source / sdr / overlay / overlayline.cxx
blobff848ce1ad321772c3319086a2a18919fe552f7c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sdr/overlay/overlayline.hxx>
21 #include <svx/sdr/overlay/overlaymanager.hxx>
22 #include <basegfx/polygon/b2dpolygon.hxx>
23 #include <drawinglayer/primitive2d/PolygonMarkerPrimitive2D.hxx>
26 namespace sdr::overlay
28 drawinglayer::primitive2d::Primitive2DContainer OverlayLineStriped::createOverlayObjectPrimitive2DSequence()
30 drawinglayer::primitive2d::Primitive2DContainer aRetval;
32 if(getOverlayManager())
34 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
35 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
36 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
37 basegfx::B2DPolygon aLine;
39 aLine.append(getBasePosition());
40 aLine.append(getSecondPosition());
42 const drawinglayer::primitive2d::Primitive2DReference aReference(
43 new drawinglayer::primitive2d::PolygonMarkerPrimitive2D(
44 std::move(aLine),
45 aRGBColorA,
46 aRGBColorB,
47 fStripeLengthPixel));
49 aRetval = drawinglayer::primitive2d::Primitive2DContainer { aReference };
52 return aRetval;
55 void OverlayLineStriped::stripeDefinitionHasChanged()
57 // react on OverlayManager's stripe definition change
58 objectChange();
61 OverlayLineStriped::OverlayLineStriped(
62 const basegfx::B2DPoint& rBasePos,
63 const basegfx::B2DPoint& rSecondPos)
64 : OverlayObjectWithBasePosition(rBasePos, COL_BLACK),
65 maSecondPosition(rSecondPos)
69 OverlayLineStriped::~OverlayLineStriped()
72 } // end of namespace
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */