Fix: error in previous commit

Forgot to actually slice the span in rB6b5e1cfacab4c4605ec2d7bfef360389afe849be.
This commit is contained in:
Jacques Lucke 2021-11-26 13:29:24 +01:00
parent b066d58216
commit 63342861e7
1 changed files with 4 additions and 2 deletions

View File

@ -477,12 +477,14 @@ class GVArrayImpl_For_SlicedGVArray : public GVArrayImpl {
protected:
GVArray varray_;
int64_t offset_;
IndexRange slice_;
public:
GVArrayImpl_For_SlicedGVArray(GVArray varray, const IndexRange slice)
: GVArrayImpl(varray.type(), slice.size()),
varray_(std::move(varray)),
offset_(slice.start())
offset_(slice.start()),
slice_(slice)
{
BLI_assert(slice.one_after_last() <= varray_.size());
}
@ -503,7 +505,7 @@ class GVArrayImpl_For_SlicedGVArray : public GVArrayImpl {
}
GSpan get_internal_span() const override
{
return varray_.get_internal_span();
return varray_.get_internal_span().slice(slice_);
}
bool is_single() const override