Skip to content

Commit

Permalink
Fix negative-width/negative-space characters breaking the renderer
Browse files Browse the repository at this point in the history
Closes #1243
  • Loading branch information
glacambre committed Nov 19, 2021
1 parent ff6b8f0 commit 3624c47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,8 @@ function paint (_: DOMHighResTimeStamp) {
if (pixelX >= 0
&& pixelY >= 0
&& (pixelX + width < canvas.width)
&& (pixelY + charHeight < canvas.height)) {
&& (pixelY + charHeight < canvas.height)
&& width > 0 && charHeight > 0) {
glyphCache[id] = context.getImageData(
pixelX,
pixelY,
Expand Down

0 comments on commit 3624c47

Please sign in to comment.