oerc-music / meld-clients-core

MELD Clients Core: Music Encoding and Linked Data
BSD 3-Clause "New" or "Revised" License
3 stars 5 forks source link

score container ignores pre-generated SVGs #4

Open musicog opened 5 years ago

musicog commented 5 years ago

The score container's render function currently ignores pregenerated SVGs:

 55  render() {
 56     if(Object.keys(this.props.score).length) {
 57       if(this.props.score.MEI[this.props.uri]) {
 58         this.props.score.vrvTk.loadData(this.props.score.MEI[this.props.uri]);
 59         this.props.score.vrvTk.setOptions(this.props.options ? this.props.options : defaultVrvOptions);
 60         var svg = this.props.score.vrvTk.renderToSVG(this.props.score.pageNum) ;
 61       } else if (this.props.score.SVG[this.props.uri]) {
 62         svg = this.props.score.SVG[this.props.uri];
 63       } else {
 64         svg = '';
 65       }

With this logic the conditional in line 61 will not be reached, since we must necessarily have the MEI for a particular URI (line 57) for the SVG to exist in the first place.