diff --git a/src/vector/vrle.cpp b/src/vector/vrle.cpp index 7fd4004799..0fedea0099 100644 --- a/src/vector/vrle.cpp +++ b/src/vector/vrle.cpp @@ -291,6 +291,7 @@ public: void translate(const VPoint &pt); void opAdd(const VRleImpl &other, VRleImpl &res); VRect bbox(); + void reset(); public: VRect m_bbox; @@ -327,6 +328,14 @@ VRect VRleImpl::bbox() return m_bbox; } +void VRleImpl::reset() +{ + m_spans.clear(); + m_bbox = VRect(); + mOffset = VPoint(); + mBboxDirty = false; +} + void VRleImpl::translate(const VPoint &pt) { // take care of last offset if applied @@ -759,6 +768,12 @@ const VRle::Span *VRle::data() const return d->impl.m_spans.data(); } +void VRle::reset() +{ + detach(); + d->impl.reset(); +} + VRle VRle::toRle(const VRect &rect) { if (rect.isEmpty()) return VRle(); diff --git a/src/vector/vrle.h b/src/vector/vrle.h index 5b0e003fe8..5e2bc1ba23 100644 --- a/src/vector/vrle.h +++ b/src/vector/vrle.h @@ -35,6 +35,7 @@ public: VRle &intersect(const VRect &r); int size() const; const VRle::Span * data() const; + void reset(); VRle operator~() const; VRle operator+(const VRle &o) const; VRle operator-(const VRle &o) const;