fix bucket undo
This commit is contained in:
@@ -2793,9 +2793,11 @@ Action* ActionStroke::get_redo()
|
||||
|
||||
layer->m_rtt[i].bindFramebuffer();
|
||||
|
||||
auto box = clear_layer ? glm::ivec4(layer->m_dirty_box[i]) : m_box[i];
|
||||
|
||||
// save image before commit
|
||||
glm::vec2 box_or = xy(m_box[i]);
|
||||
glm::vec2 box_sz = zw(m_box[i]) - xy(m_box[i]);
|
||||
glm::vec2 box_or = xy(box);
|
||||
glm::vec2 box_sz = zw(box) - xy(box);
|
||||
if (box_sz.x > 0 && box_sz.y > 0 && box_sz.x <= layer->w && box_sz.y <= layer->h)
|
||||
{
|
||||
action->m_image[i] = std::make_unique<uint8_t[]>(box_sz.x * box_sz.y * 4);
|
||||
@@ -2806,7 +2808,7 @@ Action* ActionStroke::get_redo()
|
||||
LOG("create_action invalid box size (%d, %d)", (int)box_sz.x, (int)box_sz.y);
|
||||
}
|
||||
|
||||
action->m_box[i] = m_box[i];
|
||||
action->m_box[i] = box;
|
||||
action->m_old_box[i] = layer->m_dirty_box[i];
|
||||
action->m_old_dirty[i] = layer->m_dirty_face[i];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user