@@ 1114-1131 (lines=18) @@ | ||
1111 | var bar1 = '<rect width="&W" height="' + mh + '" x="&X" y="&Y" fill="' + settings.color + '" />'; |
|
1112 | ||
1113 | var len, current; |
|
1114 | for(var y=0; y<lines; y++){ |
|
1115 | len = 0; |
|
1116 | current = digit[y][0]; |
|
1117 | for (var x=0; x<columns; x++){ |
|
1118 | if ( current == digit[y][x] ) { |
|
1119 | len++; |
|
1120 | } else { |
|
1121 | if (current == '1') { |
|
1122 | svg += bar1.replace("&W", len * mw).replace("&X", (x - len) * mw).replace("&Y", y * mh); |
|
1123 | } |
|
1124 | current = digit[y][x]; |
|
1125 | len=1; |
|
1126 | } |
|
1127 | } |
|
1128 | if ( (len > 0) && (current == '1') ){ |
|
1129 | svg += bar1.replace("&W", len * mw).replace("&X", (columns - len) * mw).replace("&Y", y * mh); |
|
1130 | } |
|
1131 | } |
|
1132 | ||
1133 | if (settings.showHRI){ |
|
1134 | svg += '<g transform="translate(' + Math.floor(width/2) + ' 0)">'; |
|
@@ 1061-1076 (lines=16) @@ | ||
1058 | var bar1 = "<div style=\"float: left; font-size: 0px; width:0; border-left: &Wpx solid " + settings.color + "; height: " + mh + "px;\"></div>"; |
|
1059 | ||
1060 | var len, current; |
|
1061 | for(var y=0; y<lines; y++){ |
|
1062 | len = 0; |
|
1063 | current = digit[y][0]; |
|
1064 | for (var x=0; x<columns; x++){ |
|
1065 | if ( current == digit[y][x] ) { |
|
1066 | len++; |
|
1067 | } else { |
|
1068 | content += (current == '0' ? bar0 : bar1).replace("&W", len * mw); |
|
1069 | current = digit[y][x]; |
|
1070 | len=1; |
|
1071 | } |
|
1072 | } |
|
1073 | if (len > 0){ |
|
1074 | content += (current == '0' ? bar0 : bar1).replace("&W", len * mw); |
|
1075 | } |
|
1076 | } |
|
1077 | if (settings.showHRI){ |
|
1078 | content += "<div style=\"clear:both; width: 100%; background-color: " + settings.bgColor + "; color: " + settings.color + "; text-align: center; font-size: " + settings.fontSize + "px; margin-top: " + settings.marginHRI + "px;\">"+hri+"</div>"; |
|
1079 | } |