Skip to content

Commit

Permalink
fix bugs with iterators, thx to ice0
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwarthog authored and morevnaproject committed Mar 4, 2020
1 parent 933dfe9 commit d6aaadd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ OptimizerBlendAssociative::run(const RunParams& params) const
new_list->sub_tasks.insert(new_list->sub_tasks.begin(), blend->sub_task_a());
for(Task::List::iterator i = new_list->sub_tasks.begin(); i != new_list->sub_tasks.end();)
{
if (!*i) { i = list->sub_tasks.erase(i); continue; }
if (!*i) { i = new_list->sub_tasks.erase(i); continue; }
if (!i->type_is<TaskBlend>())
if (TaskInterfaceBlendToTarget *interface = i->type_pointer<TaskInterfaceBlendToTarget>())
if (!interface->blend) {
Expand Down
6 changes: 3 additions & 3 deletions synfig-studio/src/synfigapp/actions/layermove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,16 @@ Action::LayerMove::perform()
dest_canvas=subcanvas;

// Find the iterator for the layer
Canvas::iterator iter = subcanvas->find_index(layer, old_index);
Canvas::iterator iter = src_canvas->find_index(layer, old_index);
if (*iter != layer)
throw Error(_("This layer doesn't exist anymore."));

// synfig::info(__FILE__":%d: layer->count()=%d",__LINE__,layer.count());

// If the subcanvas isn't the same as the canvas,
// If the src_canvas isn't the same as the canvas,
// then it had better be an inline canvas. If not,
// bail
//if(get_canvas()!=subcanvas && !subcanvas->is_inline())
//if(get_canvas()!=src_canvas && !src_canvas->is_inline())
if(get_canvas()->get_root()!=dest_canvas->get_root() || get_canvas()->get_root()!=src_canvas->get_root())
throw Error(_("You cannot directly move layers across compositions"));

Expand Down

0 comments on commit d6aaadd

Please sign in to comment.