/* === M A C R O S ========================================================= */
+#define ALLOW_CLONE_NON_INLINE_CANVASES
+
struct _CanvasCounter
{
static int counter;
{
name=get_id()+"_CLONE";
+#ifndef ALLOW_CLONE_NON_INLINE_CANVASES
throw runtime_error("Cloning of non-inline canvases is not yet supported");
+#endif // ALLOW_CLONE_NON_INLINE_CANVASES
}
Handle canvas(new Canvas(name));
!composite->reads_context())
{
Canvas::Handle sub_canvas(Canvas::create_inline(op_canvas));
- sub_canvas->push_back(composite = composite->clone());
+ // don't use clone() because it re-randomizes the seeds of any random valuenodes
+ sub_canvas->push_back(composite = composite->simple_clone());
layer = Layer::create("PasteCanvas");
composite->set_description(strprintf("Wrapped clone of '%s'", composite->get_non_empty_description().c_str()));
layer->set_description(strprintf("PasteCanvas wrapper for '%s'", composite->get_non_empty_description().c_str()));
(*iter)->add_to_group(new_name);
}
}
+
+void
+Canvas::register_external_canvas(String file_name, Handle canvas)
+{
+ if(!is_absolute_path(file_name)) file_name = get_file_path()+ETL_DIRECTORY_SEPARATOR+file_name;
+ externals_[file_name] = canvas;
+}