template "widget[@type='Animate']", mode="widget_class"{
class AnimateWidget extends Widget{
widget_center = undefined;
// change animation properties
for(let child of this.element.children){
if(child.nodeName.startsWith("animate")){
if(this.speed != 0 && !this.start){
this.element.beginElement();
child.setAttribute("dur", this.speed+"s");
child.setAttribute("dur", (-1)*this.speed+"s");
this.element.endElement();
let widget_pos = this.element.getBBox();
this.widget_center = [(widget_pos.x+widget_pos.width/2), (widget_pos.y+widget_pos.height/2)];
template "widget[@type='Animate']", mode="widget_defs" {