13 : p0_(p0), p1_(p1), on_length_(on_length), off_length_(off_length) {}
42 if (length > 0.0f && on_length_ >= 0.0f && off_length_ > 0.0f) {
43 Point delta = (p1_ - p0_) / length;
46 while (consumed < length) {
47 receiver.
MoveTo(p0_ + delta * consumed,
false);
49 Scalar dash_end = consumed + on_length_;
50 if (dash_end < length) {
51 receiver.
LineTo(p0_ + delta * dash_end);
59 consumed = dash_end + off_length_;
62 receiver.
MoveTo(p0_,
false);
DashedLinePathSource(Point p0, Point p1, Scalar on_length, Scalar off_length)
bool IsConvex() const override
FillType GetFillType() const override
Rect GetBounds() const override
void Dispatch(PathReceiver &receiver) const override
Collection of functions to receive path segments from the underlying path representation via the DlPa...
virtual void LineTo(const Point &p2)=0
virtual void MoveTo(const Point &p2, bool will_be_closed)=0
constexpr Type GetDistance(const TPoint &p) const
constexpr TRect GetPositive() const
Get a version of this rectangle that has a non-negative size.
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)