- root->set_attribute("type","radial_gradient");
- root->set_attribute("active","true");
- build_param (root->add_child("param"),"z_depth","real","0");
- build_param (root->add_child("param"),"amount","real","1");
- //straight onto
- build_param (root->add_child("param"),"blend_method","integer","21");
+ xmlpp::Element* gradient;
+
+ if (mtx || data->transform) {
+ xmlpp::Element* layer=root->add_child("layer");
+
+ layer->set_attribute("type","PasteCanvas");
+ layer->set_attribute("active","true");
+ layer->set_attribute("version","0.1");
+ layer->set_attribute("desc","Composite");
+ build_param (layer->add_child("param"),"z_depth","real","0");
+ build_param (layer->add_child("param"),"amount","real","1");
+ build_param (layer->add_child("param"),"blend_method","integer","21"); //straight onto
+ build_vector (layer->add_child("param"),"origin",0,0);
+ xmlpp::Element *child=layer->add_child("param");
+ child->set_attribute("name","canvas");
+ xmlpp::Element* child_layer=child->add_child("canvas");
+
+ gradient=child_layer->add_child("layer");
+ build_param (gradient->add_child("param"),"blend_method","integer","0"); //composite
+ Matrix *mtx2=NULL;
+ if (mtx && data->transform){
+ composeMatrix(&mtx2,mtx,data->transform);
+ }else if (mtx){
+ mtx2=mtx;
+ }else if (data->transform){
+ mtx2=data->transform;
+ }
+ parser_transform(child_layer,mtx2);
+
+ }else {
+ gradient=root->add_child("layer");
+ build_param (gradient->add_child("param"),"blend_method","integer","21"); //straight onto
+ }
+
+ gradient->set_attribute("type","radial_gradient");
+ gradient->set_attribute("active","true");
+ build_param (gradient->add_child("param"),"z_depth","real","0");
+ build_param (gradient->add_child("param"),"amount","real","1");