LibreOffice Module svx (master) 1
overlayrollingrectangle.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
28
29namespace sdr::overlay
30{
32 {
34
36 {
37 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
38 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
39 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
40 const basegfx::B2DRange aRollingRectangle(getBasePosition(), getSecondPosition());
41
42 if(mbShowBounds)
43 {
44 // view-independent part, create directly
45 const basegfx::B2DPolygon aPolygon(basegfx::utils::createPolygonFromRect(aRollingRectangle));
46
47 aRetval.resize(2);
50 aRGBColorA,
51 aRGBColorB,
52 fStripeLengthPixel);
53
54 const basegfx::BColor aHilightColor(SvtOptionsDrawinglayer::getHilightColor().getBColor());
55 const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
56
59 aHilightColor,
60 fTransparence,
61 3.0,
62 false);
63 }
64
66 {
67 // view-dependent part, use helper primitive
70 aRollingRectangle,
71 aRGBColorA,
72 aRGBColorB,
73 fStripeLengthPixel));
74
75 aRetval.push_back(aReference);
76 }
77 }
78
79 return aRetval;
80 }
81
83 {
84 // react on OverlayManager's stripe definition change
86 }
87
89 const basegfx::B2DPoint& rBasePos,
90 const basegfx::B2DPoint& rSecondPos,
91 bool bExtendedLines,
92 bool bShowBounds)
94 maSecondPosition(rSecondPos),
95 mbExtendedLines(bExtendedLines),
96 mbShowBounds(bShowBounds)
97 {
98 }
99
101 {
102 }
103
105 {
106 if(rNew != maSecondPosition)
107 {
108 // remember new value
109 maSecondPosition = rNew;
110
111 // register change (after change)
112 objectChange();
113 }
114 }
115} // end of namespace
116
117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
basegfx::B2DPoint maSecondPosition
const basegfx::B2DPoint & getBasePosition() const
OverlayManager * getOverlayManager() const
OverlayRollingRectangleStriped(const basegfx::B2DPoint &rBasePos, const basegfx::B2DPoint &rSecondPos, bool bExtendedLines, bool bShowBounds=true)
void setSecondPosition(const basegfx::B2DPoint &rNew)
virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override
const basegfx::B2DPoint & getSecondPosition() const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
sal_uInt16 GetTransparentSelectionPercent()
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)