tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

SVGArcConverter.h (1000B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef DOM_SVG_SVGARCCONVERTER_H_
      8 #define DOM_SVG_SVGARCCONVERTER_H_
      9 
     10 #include "mozilla/gfx/Point.h"
     11 
     12 namespace mozilla {
     13 
     14 class MOZ_STACK_CLASS SVGArcConverter {
     15  using Point = mozilla::gfx::Point;
     16 
     17 public:
     18  SVGArcConverter(const Point& from, const Point& to, const Point& radii,
     19                  double angle, bool largeArcFlag, bool sweepFlag);
     20  bool GetNextSegment(Point* cp1, Point* cp2, Point* to);
     21 
     22 protected:
     23  int32_t mNumSegs;
     24  int32_t mSegIndex = 0;
     25  double mTheta, mDelta, mT;
     26  double mSinPhi, mCosPhi;
     27  double mRx, mRy;
     28  Point mFrom, mTo, mC;
     29  bool mFallBackToSingleLine = false;
     30 };
     31 
     32 }  // namespace mozilla
     33 
     34 #endif  // DOM_SVG_SVGARCCONVERTER_H_