fix rtt copy/move

This commit is contained in:
2019-10-15 16:59:55 +02:00
parent 9ccd6ed2f4
commit 5f002cca53
6 changed files with 161 additions and 73 deletions

View File

@@ -1322,8 +1322,11 @@ void App::initLayout()
auto frame_text = layout[main_id]->find<NodeText>("timeline-frame");
slider->on_value_changed = [this, frame_text](Node*, float value)
{
auto& l = Canvas::I->layer();
l.m_frame_index = (int)glm::clamp<int>(
floor(value * l.m_frames.size()), 0, (int)l.m_frames.size() - 1);
/*
auto& c = *Canvas::I;
for (int i = 0; i < c.m_layers.size(); i++)
{
auto l = layers->get_layer_at(i);
@@ -1353,11 +1356,12 @@ void App::initLayout()
snprintf(str, sizeof(str), "%02d", current_layer);
frame_text->set_text(str);
}
*/
};
if (auto btn_add = timeline->find<NodeButtonCustom>("btn-add"))
{
btn_add->on_click = [this, slider] (Node*) {
layers->add_layer(true, true);
Canvas::I->layer().add_frame();
slider->set_value(1.f, true);
};
}