Skip to content

Commit

Permalink
sv to svg
Browse files Browse the repository at this point in the history
  • Loading branch information
lindenb committed Oct 11, 2021
1 parent 149a363 commit 96e4ef0
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ private Element buildSample(

final Element readElement = element("g");
// https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin
readElement.setAttribute("transform-origin", "center");
readElement.setAttribute("style","transform-origin:center");
if(shortRead.isSplitRead()) { //always in front
animationLayer.appendChild(readElement);
}
Expand Down Expand Up @@ -922,6 +922,8 @@ private void buildDocument()
forEach(SR->{
if(this.svgDuration<=0) return;

final boolean rotate = SR.getContig().equals(SR.source.getContig()) && SR.isNegativeStrand()!=SR.source.isNegativeStrand();

Element anim = element("animateTransform");
SR.element.appendChild(anim);
anim.setAttribute("attributeType","XML");
Expand All @@ -935,22 +937,24 @@ private void buildDocument()
anim.setAttribute("fill","freeze");


/* if !=strand rotate around center.x,center.y
if(SR.getContig().equals(SR.source.getContig()) && SR.isNegativeStrand()!=SR.source.isNegativeStrand())
if(rotate) // doesn't work
{
/*
anim = element("animateTransform");
SR.element.appendChild(anim);
anim.setAttribute("attributeType","XML");
anim.setAttribute("attributeName","transform");
anim.setAttribute("type","rotate");
anim.setAttribute("begin","0s");
anim.setAttribute("from","0");
anim.setAttribute("to","180");
anim.setAttribute("from","0 "+(format(-1*SR.getPixelStart()))+" "+format(-1*SR.y));
anim.setAttribute("to","180 "+(format(-1*SR.source.getPixelStart()))+" "+format(-1*SR.source.y));
anim.setAttribute("dur",String.valueOf(this.svgDuration)+"s");
anim.setAttribute("repeatCount",this.svgRepeatCount);
anim.setAttribute("fill","freeze");
}*/
*/
}


});
Expand Down

0 comments on commit 96e4ef0

Please sign in to comment.