char-to-avatar
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -10,3 +10,3 @@ // **Github:** https://github.com/teambition/char-to-avatar | ||
var app = toa(function *() { | ||
var app = toa(function () { | ||
if (this.path === '/favicon.ico') this.body = null | ||
@@ -19,6 +19,4 @@ else { | ||
}) | ||
var dataURL = yield avatar.toDataURL() | ||
console.log(dataURL.length) | ||
this.type = 'html' | ||
this.body = `<img src="${dataURL}" />` | ||
this.type = 'png' | ||
this.body = avatar.pngStream() | ||
} | ||
@@ -25,0 +23,0 @@ }) |
@@ -13,3 +13,2 @@ // **Github:** https://github.com/teambition/char-to-avatar | ||
CharToAvatar.textBaseline = 'middle' | ||
CharToAvatar.textFactor = 0.95 | ||
@@ -41,5 +40,3 @@ function CharToAvatar (character, options) { | ||
ctx.patternQuality = 'nearest' | ||
var fix = Math.floor(radius * CharToAvatar.textFactor) | ||
ctx.fillText(character, Math.floor(fix * CharToAvatar.textFactor), fix, fix) | ||
ctx.fillText(character, radius, radius, radius) | ||
} | ||
@@ -46,0 +43,0 @@ |
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"main": "index.js", | ||
@@ -10,0 +10,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8652
80