Cleanup: GPv3: Use Layer::is_empty()
Also adds a docstring for the `is_empty()` method.
This commit is contained in:
@@ -420,6 +420,9 @@ class Layer : public ::GreasePencilLayer {
|
||||
const Map<FramesMapKey, GreasePencilFrame> &frames() const;
|
||||
Map<FramesMapKey, GreasePencilFrame> &frames_for_write();
|
||||
|
||||
/**
|
||||
* \returns true, if the layer contains no keyframes.
|
||||
*/
|
||||
bool is_empty() const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -348,7 +348,7 @@ bool ensure_active_keyframe(const Scene &scene,
|
||||
|
||||
/* If auto-key is on and the drawing at the current frame starts before the current frame a new
|
||||
* keyframe needs to be inserted. */
|
||||
const bool is_first = active_layer.sorted_keys().is_empty() ||
|
||||
const bool is_first = active_layer.is_empty() ||
|
||||
(active_layer.sorted_keys().first() > current_frame);
|
||||
const bool needs_new_drawing = is_first ||
|
||||
(*active_layer.frame_key_at(current_frame) < current_frame);
|
||||
|
||||
Reference in New Issue
Block a user