Make Executor work in workers
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
} from '../../transform.js';
|
||||
import {defaultTextAlign, measureTextHeight, measureAndCacheTextWidth, measureTextWidths} from '../canvas.js';
|
||||
import RBush from 'rbush/rbush.js';
|
||||
import {WINDOW} from '../../has.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -204,7 +205,9 @@ class Executor {
|
||||
contextInstructions.push('lineCap', strokeState.lineCap);
|
||||
contextInstructions.push('lineJoin', strokeState.lineJoin);
|
||||
contextInstructions.push('miterLimit', strokeState.miterLimit);
|
||||
if (CanvasRenderingContext2D.prototype.setLineDash) {
|
||||
// eslint-disable-next-line
|
||||
const Context = WINDOW ? CanvasRenderingContext2D : OffscreenCanvasRenderingContext2D;
|
||||
if (Context.prototype.setLineDash) {
|
||||
contextInstructions.push('setLineDash', [strokeState.lineDash]);
|
||||
contextInstructions.push('lineDashOffset', strokeState.lineDashOffset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user