improve animation panel

This commit is contained in:
2019-10-19 22:30:44 +02:00
parent e25de3c454
commit 27576443ca
12 changed files with 120 additions and 25 deletions

View File

@@ -214,10 +214,10 @@ void NodeCanvas::draw()
auto layer_index = i;
for (int plane_index = 0; plane_index < 6; plane_index++)
{
int onion_size = 1;
int onion_size = App::I->animation->get_onion_size();
int frame_current = m_canvas->m_layers[layer_index]->m_frame_index;
int frame_start = glm::max<int>(frame_current - 1, 0);
int frame_end = glm::min<int>(frame_current + 1, m_canvas->m_layers[layer_index]->m_frames.size() - 1);
int frame_start = glm::max<int>(frame_current - onion_size, 0);
int frame_end = glm::min<int>(frame_current + onion_size, m_canvas->m_layers[layer_index]->m_frames.size() - 1);
bool faces = false;
for (int frame = frame_start; frame <= frame_end; frame++)
faces |= m_canvas->m_layers[layer_index]->face(plane_index, frame);