diff --git a/packages/vrender-kits/src/canvas/contributions/lynx/context.ts b/packages/vrender-kits/src/canvas/contributions/lynx/context.ts index 8629efcc5..30f827541 100644 --- a/packages/vrender-kits/src/canvas/contributions/lynx/context.ts +++ b/packages/vrender-kits/src/canvas/contributions/lynx/context.ts @@ -74,8 +74,15 @@ export class LynxContext2d extends BrowserContext2d implements IContext2d { method: 'native' | 'simple' | 'quick' = application.global.measureTextMethod ): { width: number } { this.setTransform(1, 0, 0, 1, 0, 0, true, application.global.devicePixelRatio); - const data = super.measureText(text, method); - return data; + const data: any = super.measureText(text, method); + // lynx环境中的fontBoundingBoxDescent和fontBoundingBoxAscent有严重偏移,暂时规避 + return { + width: data.width, + fontBoundingBoxDescent: undefined, + fontBoundingBoxAscent: undefined, + actualBoundingBoxAscent: undefined, + actualBoundingBoxDescent: undefined + } as any; } createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern {