Initial Grease Pencil 3.0 stage #106848
|
@ -419,6 +419,10 @@ Span<int> Layer::sorted_keys() const
|
|||
int Layer::drawing_index_at(int frame) const
|
||||
{
|
||||
Span<int> sorted_keys = this->sorted_keys();
|
||||
|
||||
/* No keyframes, return no drawing. */
|
||||
if (sorted_keys.size() == 0) {
|
||||
return -1;
|
||||
}
|
||||
/* Before the first drawing, return no drawing. */
|
||||
if (frame < sorted_keys.first()) {
|
||||
Hans Goudey
commented
Any reason to call Any reason to call `clear_and_shrink` here? Might as well call `reinitialize` if not
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue
Forget if we talked about this already, but without
std::move
in the function, there doesn't seem to be much of a point to this second override. Usually there is one for a const reference and one for an rvalue, I haven't seen a non-const reference override like this before.Maybe @JacquesLucke can clarify here, but I believe sine
add_overwrite
has an implementation with an r-value reference that does thestd::move
I think this is fine?I recommend just using a debugger to see if this calls the function you intend to call (the one with an rvalue reference). Haven't tried right now, but it will probably call the const reference version without
std::move
.