fix bucket undo
This commit is contained in:
@@ -3216,10 +3216,10 @@ void Layer::optimize()
|
||||
|
||||
void Layer::restore(const Snapshot& snap)
|
||||
{
|
||||
//clear({ 0, 0, 0, 0 });
|
||||
clear({ 0, 0, 0, 0 });
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
if (snap.image[i] == nullptr || snap.m_dirty_face[i] == false)
|
||||
if (snap.image[i] == nullptr)
|
||||
continue;
|
||||
|
||||
m_dirty_box[i] = snap.m_dirty_box[i];
|
||||
@@ -3242,7 +3242,7 @@ void Layer::restore(const Snapshot& snap)
|
||||
}
|
||||
}
|
||||
|
||||
Layer::Snapshot Layer::snapshot(glm::vec4 dirty_box[6] /*= nullptr*/, bool dirty_face[6] /*= nullptr*/)
|
||||
Layer::Snapshot Layer::snapshot(std::array<glm::vec4, 6> * dirty_box /*= nullptr*/, std::array<bool, 6> * dirty_face /*= nullptr*/)
|
||||
{
|
||||
Snapshot snap;
|
||||
static int counter = 0;
|
||||
@@ -3250,8 +3250,8 @@ Layer::Snapshot Layer::snapshot(glm::vec4 dirty_box[6] /*= nullptr*/, bool dirty
|
||||
//glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
snap.m_dirty_box[i] = dirty_box ? dirty_box[i] : m_dirty_box[i];
|
||||
snap.m_dirty_face[i] = dirty_face ? dirty_face[i] : m_dirty_face[i];
|
||||
snap.m_dirty_box[i] = dirty_box ? dirty_box->at(i) : m_dirty_box[i];
|
||||
snap.m_dirty_face[i] = dirty_face ? dirty_face->at(i) : m_dirty_face[i];
|
||||
|
||||
if (!snap.m_dirty_face[i])
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user