Get webgl glyphs scaling to cell size, invalidate on option change

This commit is contained in:
Daniel Imms
2021-08-18 08:29:07 -07:00
parent da0928102b
commit 011026a8d1
4 changed files with 10 additions and 8 deletions
-5
View File
@@ -404,15 +404,10 @@ function drawPatternChar(
imageData.data[(y * width + x) * 4 + 3] = charDefinition[y][x] * (a ?? 255);
}
}
console.log('put', imageData);
tmpCtx.putImageData(imageData, 0, 0);
// TODO: This will break for different colored patterns
// TODO: This could happen multiple times
pattern = throwIfFalsy(ctx.createPattern(tmpCanvas, null));
patternSet.set(fillStyle, pattern);
}
console.log('fill style', pattern);
ctx.fillStyle = pattern;
ctx.fillRect(xOffset, yOffset, scaledCellWidth, scaledCellHeight);
}