Cleanup: GPv3: Change order of constructors

This commit is contained in:
Falk David
2024-05-08 17:15:30 +02:00
parent 07e78f613b
commit 8056a31a7e
2 changed files with 11 additions and 11 deletions

View File

@@ -71,8 +71,8 @@ class Drawing : public ::GreasePencilDrawing {
public:
Drawing();
Drawing(const Drawing &other);
Drawing &operator=(const Drawing &other);
Drawing(Drawing &&other);
Drawing &operator=(const Drawing &other);
Drawing &operator=(Drawing &&other);
~Drawing();

View File

@@ -315,16 +315,6 @@ Drawing::Drawing(const Drawing &other)
this->runtime->curve_texture_matrices = other.runtime->curve_texture_matrices;
}
Drawing &Drawing::operator=(const Drawing &other)
{
if (this == &other) {
return *this;
}
std::destroy_at(this);
new (this) Drawing(other);
return *this;
}
Drawing::Drawing(Drawing &&other)
{
this->base.type = GP_DRAWING;
@@ -338,6 +328,16 @@ Drawing::Drawing(Drawing &&other)
other.runtime = nullptr;
}
Drawing &Drawing::operator=(const Drawing &other)
{
if (this == &other) {
return *this;
}
std::destroy_at(this);
new (this) Drawing(other);
return *this;
}
Drawing &Drawing::operator=(Drawing &&other)
{
if (this == &other) {