42 if (!drawFrame)
return rect;
56 bool vertic = dir[0] == 0;
57 bool horiz = dir[1] == 0;
58 if (!horiz && !vertic && dir[0]*dir[0]+dir[1]*dir[1] > 25)
return false;
62 if (horiz || vertic) {
65 if (
X[0] <
X[1])
X[1]+=pSize.
Width();
81 { orig.
X(), orig.
Y()+pSize.
Height() }};
82 int origAvoid = dir[0] > 0 ? (dir[1] > 0 ? 2 : 1) : (dir[1] > 0 ? 3 : 0);
85 { dest.
X(), dest.
Y()+pSize.
Height() }};
86 for (
int w = origAvoid+1;
w < origAvoid+4;
w++) {
90 for (
int w = origAvoid+3;
w < origAvoid+6;
w++) {
94 int wh = (origAvoid+1)%4;
119 poly.
append(
B2DPoint(
double(orig.
X()+decal[0]),
double(orig.
Y()+decal[1])));
120 poly.
append(
B2DPoint(
double(dest.
X()+decal[0]),
double(dest.
Y()+decal[1])));
168 double angl1 = angle1-M_PI_2;
169 double angl2 = angle2-M_PI_2;
175 while (angl1 < 0.0) { angl1 += 2 * M_PI; angl2 += 2 * M_PI; }
176 while (angl1 >= 2 * M_PI) { angl1 -= 2 * M_PI; angl2 -= 2 * M_PI; }
180 if (angl2 >= angl1 + 2 * M_PI) angl2 = angl1-0.001;
183 while (angl2 < 0.0) angl2 += 2 * M_PI;
184 while (angl2 >= 2 * M_PI) angl2 -= 2 * M_PI;
199 int ovalW=ovalSize.
Width(), ovalH=ovalSize.
Height();
205 if (ovalW > width) ovalW =
static_cast< int >( width );
206 if (ovalH > height) ovalH =
static_cast< int >( height );
222 decalTL[0] += penSize/2; decalTL[1] += penSize/2;
223 decalBR[0] -= (penSize+1)/2; decalBR[1] -= (penSize+1)/2;
226 else decalBR[0] = decalBR[1] = 0;
230 if (numPt <= 1)
return;
233 double bary[2] = { 0.0, 0.0 };
234 for (
int i = 0;
i < numPt;
i++) {
236 bary[0] += double(
pt.X()); bary[1] += double(
pt.Y());
238 bary[0]/=double(numPt); bary[1]/=double(numPt);
244 for (
int i = 0;
i < numPt;
i++) {
246 double x = (double(
pt.X()) < bary[0]) ?
pt.X()+decalTL[0] :
pt.X()+decalBR[0];
247 double y = (double(
pt.Y()) < bary[1]) ?
pt.Y()+decalTL[1] :
pt.Y()+decalBR[1];
void DrawPolyLine(const tools::Polygon &rPoly)
Render the given polygon as a line stroke.
void DrawPolygon(const tools::Polygon &rPoly)
Render the given polygon.
const Color & GetLineColor() const
const Color & GetFillColor() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void reserve(sal_uInt32 nCount)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Osnola: IMPORTANT NOTE: some Quickdraw lines/frames can not be "quickly" drawn exactly: for instance,...
static tools::Rectangle contractRectangle(bool drawFrame, tools::Rectangle const &rect, Size const &pSize)
returns an inside rectangle knowing the penSize in order to obtain the `‘correct’' position when we d...
void drawRectangle(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, Size const &pSize)
draws a rectangle knowing penSize
void drawEllipse(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, Size const &pSize)
draws an ellipse knowing penSize
void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize)
draws a line from orig to dest knowing penSize
void drawArc(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, const double &angle1, const double &angle2, Size const &pSize)
draws an arc in a b2dpolygon knowing penSize
static bool drawLineHQ(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize)
void drawPolygon(VirtualDevice *dev, bool drawFrame, tools::Polygon const &orig, Size const &pSize)
draws a polygon knowing penSize
void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, Size const &ovalSize, Size const &pSize)
draws a rounded rectangle knowing penSize
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
B2DPolygon createPolygonFromEllipseSegment(const B2DPoint &rCenter, double fRadiusX, double fRadiusY, double fStart, double fEnd)
B2DPolygon createPolygonFromEllipse(const B2DPoint &rCenter, double fRadiusX, double fRadiusY, sal_uInt32 nStartQuadrant=0)