@@ -30,6 +30,7 @@ new function() {
3030 // Base.pick(base.value, base)
3131 return base
3232 ? index !== undefined
33+ // Item list? Look up by index:
3334 ? index < base . numberOfItems
3435 ? Base . pick ( ( base = base . getItem ( index ) ) . value , base )
3536 : null
@@ -56,7 +57,7 @@ new function() {
5657 return value === 'none'
5758 ? null
5859 : type === 'number'
59- ? Base . toFloat ( value )
60+ ? parseFloat ( value )
6061 : type === 'array'
6162 ? value ? value . split ( / [ \s , ] + / g) . map ( parseFloat ) : [ ]
6263 : type === 'color' && getDefinition ( value )
@@ -358,6 +359,9 @@ new function() {
358359 function applyAttributes ( item , node ) {
359360 // SVG attributes can be set both as styles and direct node attributes,
360361 // so we need to parse both
362+ // TODO: Instead of looping through the styles, we need to loop through
363+ // a list of styles relevant to SVG, and calculate the computed style,
364+ // to support style classes too.
361365 for ( var i = 0 , l = node . style . length ; i < l ; i ++ ) {
362366 var name = node . style [ i ] ;
363367 item = applyAttribute ( item , node , name , node . style [ Base . camelize ( name ) ] ) ;
@@ -411,7 +415,7 @@ new function() {
411415 case 'stop-opacity' :
412416 // http://www.w3.org/TR/SVG/masking.html#OpacityProperty
413417 case 'opacity' :
414- var opacity = Base . toFloat ( value ) ;
418+ var opacity = parseFloat ( value ) ;
415419 if ( name === 'stop-opacity' ) {
416420 item . color . setAlpha ( opacity ) ;
417421 } else {
@@ -425,7 +429,7 @@ new function() {
425429 var color = item [ name == 'fill-opacity' ? 'getFillColor'
426430 : 'getStrokeColor' ] ( ) ;
427431 if ( color )
428- color . setAlpha ( Base . toFloat ( value ) ) ;
432+ color . setAlpha ( parseFloat ( value ) ) ;
429433 break ;
430434 case 'visibility' :
431435 item . setVisible ( value === 'visible' ) ;
@@ -485,7 +489,7 @@ new function() {
485489 item . setFont ( value . split ( ',' ) [ 0 ] . replace ( / ^ \s + | \s + $ / g, '' ) ) ;
486490 break ;
487491 case 'font-size' :
488- item . setFontSize ( Base . toFloat ( value ) ) ;
492+ item . setFontSize ( parseFloat ( value ) ) ;
489493 break ;
490494 case 'text-anchor' :
491495 item . setJustification ( {
0 commit comments