Merge pull request #10597 from Snuffleupagus/isFontSubpixelAAEnabled-canvas-cleanup

Ensure that the temporary canvas created in `CanvasGraphics.isFontSubpixelAAEnabled` will be cleared
This commit is contained in:
Tim van der Meij 2019-02-28 23:37:24 +01:00 committed by GitHub
commit 39fa26ea33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1417,7 +1417,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
get isFontSubpixelAAEnabled() {
// Checks if anti-aliasing is enabled when scaled text is painted.
// On Windows GDI scaled fonts looks bad.
var ctx = this.canvasFactory.create(10, 10).context;
const { context: ctx, } =
this.cachedCanvases.getCanvas('isFontSubpixelAAEnabled', 10, 10);
ctx.scale(1.5, 1);
ctx.fillText('I', 0, 10);
var data = ctx.getImageData(0, 0, 10, 10).data;