From 72c6f0a00407ca87e6de14f9c4f48c50d0e00dd8 Mon Sep 17 00:00:00 2001 From: heyoubiao Date: Sun, 27 Sep 2020 17:01:10 +0800 Subject: [PATCH] fix eslint --- src/render/canvas/canvas-renderer.ts | 4 ++-- src/render/path.ts | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/render/canvas/canvas-renderer.ts b/src/render/canvas/canvas-renderer.ts index 069b55d..3375a2d 100644 --- a/src/render/canvas/canvas-renderer.ts +++ b/src/render/canvas/canvas-renderer.ts @@ -5,7 +5,7 @@ import {ElementContainer} from '../../dom/element-container'; import {BORDER_STYLE} from '../../css/property-descriptors/border-style'; import {CSSParsedDeclaration} from '../../css/index'; import {TextContainer} from '../../dom/text-container'; -import {Path, transformPath, reversePath } from '../path'; +import {Path, transformPath, reversePath} from '../path'; import {BACKGROUND_CLIP} from '../../css/property-descriptors/background-clip'; import {BoundCurves, calculateBorderBoxPath, calculateContentBoxPath, calculatePaddingBoxPath} from '../bound-curves'; import {isBezierCurve} from '../bezier-curve'; @@ -692,7 +692,7 @@ export class CanvasRenderer { this.path(shadowPaintingArea); } - this.ctx.shadowOffsetX = maskOffset; + this.ctx.shadowOffsetX = maskOffset; this.ctx.shadowOffsetY = 0; this.ctx.shadowColor = asString(shadow.color); this.ctx.shadowBlur = shadow.blur.number; diff --git a/src/render/path.ts b/src/render/path.ts index cf0bd6e..b853eaa 100644 --- a/src/render/path.ts +++ b/src/render/path.ts @@ -35,9 +35,12 @@ export const transformPath = (path: Path[], deltaX: number, deltaY: number, delt }); }; -export const reversePath = (path: Path[]) : Path[] => { - return path.slice(0).reverse().map((point) => { - return point.reverse(); - }); -} +export const reversePath = (path: Path[]): Path[] => { + return path + .slice(0) + .reverse() + .map(point => { + return point.reverse(); + }); +}; export type Path = Vector | BezierCurve;