Skip to content

Commit 4a44ead

Browse files
committed
Log resource errors to console
1 parent 3eaee99 commit 4a44ead

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

index.html

+8-2
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,25 @@ <h2>Demo II</h2>
121121

122122
sizeCanvas(canvas);
123123

124+
var doDraw = function () {
125+
rasterizeHTML.drawHTML(input.value, canvas).then(function (result) {
126+
console.log('errors', result.errors);
127+
});
128+
};
129+
124130
input.onkeyup = function () {
125131
if (input.value !== oldText) {
126132
oldText = input.value;
127133
canvas.getContext("2d").clearRect(0, 0, canvas.width, canvas.height);
128134

129-
rasterizeHTML.drawHTML(input.value, canvas);
135+
doDraw();
130136
}
131137
};
132138

133139
if (!input.value) {
134140
input.value = template.innerHTML.replace(/^ {4}/gm, "").replace(/^\n/g, "").replace(/\n +$/g, "\n");
135141
}
136-
rasterizeHTML.drawHTML(input.value, canvas);
142+
doDraw();
137143
}());
138144
</script>
139145

0 commit comments

Comments
 (0)