Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 1 633: | Rivi 1 633: | ||
if ( typeof v == 'string' ) { | if ( typeof v == 'string' ) { | ||
if ( v.indexOf( 'point {' ) == 0 ) { | if ( v.indexOf( 'point {' ) == 0 ) { | ||
oldsize | oldsize = parseInt( v.match( / size: .+;/g )[0].replace( ' size: ', '' ).replace( ';', '') ); | ||
oldstroke = parseFloat( v.match( / stroke-width: .+;/g )[0].replace( ' stroke-width: ', '' ).replace( ';', '') ); | |||
if ( v.indexOf( 'original-size:' ) == -1 ) { | if ( v.indexOf( 'original-size:' ) == -1 ) { | ||
v = v.replace( '{', '{ original-size: ' + oldsize.toString() + ';' ); | v = v.replace( '{', '{ original-size: ' + oldsize.toString() + ';' ); | ||
} | } | ||
orgsize = parseInt( v.match( /original-size: .+;/g )[0].replace( 'original-size: ', '' ).replace( ';', '') ); | if ( v.indexOf( 'original-stroke-size:' ) == -1 ) { | ||
v = v.replace( '{', '{ original-stroke-size: ' + oldstroke.toString() + ';' ); | |||
} | |||
orgsize = parseInt( v.match( /original-size: .+;/g )[0].replace( 'original-size: ', '' ).replace( ';', '') ); | |||
orgstroke = parseFloat( v.match( /original-stroke-size: .+;/g )[0].replace( 'original-stroke-size: ', '' ).replace( ';', '') ); | |||
newsize = Math.round( Math.sqrt( Math.sqrt( ( w / 500 ) ) ) * orgsize ); | newsize = Math.round( Math.sqrt( Math.sqrt( ( w / 500 ) ) ) * orgsize ); | ||
newstroke = Math.round( Math.sqrt( Math.sqrt( ( w / 1 ) ) ) * orgstroke ); | |||
if ( w > 500 ) { | if ( w > 500 ) { | ||
v = v.replace( ' size: ' + oldsize, ' size: ' + newsize ); | v = v.replace( ' size: ' + oldsize, ' size: ' + newsize ); | ||
v = v.replace( ' stroke-size: ' + oldstroke, ' stroke-size: ' + newstroke ); | |||
for ( var t in memo.options.trendlines ) { | for ( var t in memo.options.trendlines ) { | ||
memo.options.trendlines[t].lineWidth = Math.sqrt( (w/500) ) * memo.options.trendlines[t].originalLineWidth; | memo.options.trendlines[t].lineWidth = Math.sqrt( (w/500) ) * memo.options.trendlines[t].originalLineWidth; | ||
| Rivi 1 646: | Rivi 1 653: | ||
} else { | } else { | ||
v = v.replace( ' size: ' + oldsize, ' size: ' + orgsize ); | v = v.replace( ' size: ' + oldsize, ' size: ' + orgsize ); | ||
v = v.replace( ' stroke-size: ' + oldstroke, ' stroke-size: ' + orgstroke ); | |||
for ( var t in memo.options.trendlines ) { | for ( var t in memo.options.trendlines ) { | ||
memo.options.trendlines[t].lineWidth = memo.options.trendlines[t].originalLineWidth; | memo.options.trendlines[t].lineWidth = memo.options.trendlines[t].originalLineWidth; | ||


