diff --git a/README.md b/README.md index 389bc7e3..02e6c99e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 2,适配稿定设计pdf还原,支持导入psd还原 3,可导出图片,svg,pdf Demo:[https://yft.design](https://yft.design) -Demo:[https://pro.yft.design](https://pro.yft.design) +Demo:[https://pro.yft.design](https://pro.yft.design/editor) [介绍文章](https://juejin.cn/post/7238804998276087868) [介绍视频](https://www.bilibili.com/video/BV1Zb421H7fT/?buvid=XY3B1253C1118CEF7B4DE80267E1AD86732A0&from_spmid=main.space.0.0&is_story_h5=false&mid=TIDtF8b2h0f7OVMypYFAZQ%3D%3D&p=1&plat_id=116&share_from=ugc&share_medium=android&share_plat=android&share_session_id=56bc8446-776d-4fd6-a742-132ac702b09b&share_source=WEIXIN&share_tag=s_i&spmid=united.player-video-detail.0.0×tamp=1719707202&unique_k=Z8LQOMT&up_id=149041192) diff --git a/src/app/fabricCanvas.ts b/src/app/fabricCanvas.ts index 4612d42a..2b8e5cd0 100644 --- a/src/app/fabricCanvas.ts +++ b/src/app/fabricCanvas.ts @@ -74,7 +74,7 @@ export class FabricCanvas extends Canvas { // this.getObjects()?.forEach((board) => { // FabricObject.prototype.setCoords.call(board) // }) - // this.requestRenderAll() + this.requestRenderAll() return } this.setViewportTransform(vpt) diff --git a/src/components.d.ts b/src/components.d.ts index 3395ae9c..9c07c23d 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -101,7 +101,7 @@ export declare module 'fabric' { // on(handlers: EventRegistryObject): VoidFunction; } - export declare class Canvas { + export declare interface Canvas { __targetlessCanvasDrag?: boolean _objects: FabricObject[] ref: { @@ -122,7 +122,7 @@ export declare module 'fabric' { fire(eventName: EventName, options?: any): T; } - export declare class ActiveSelection { + export declare interface ActiveSelection { multiSelectAdd(...targets: FabricObject[]): void getObjects(...types: string[]): FabricObject[] forEachObject( @@ -130,7 +130,7 @@ export declare module 'fabric' { ): void } - export declare class Group { + export declare interface Group { id: string name: string canvas: Canvas | undefined @@ -150,7 +150,7 @@ export declare module 'fabric' { doubleClickHandler(e: TPointerEventInfo): void } - export declare class FabricObject { + export declare interface FabricObject { group: Group | undefined id: string name: string @@ -180,7 +180,7 @@ export declare module 'fabric' { hideOnLayer: boolean /** 在图层上隐藏 */ } - export declare class FabricImage { + export declare interface FabricImage { originSrc?: string effects?: EffectItem[] mask?: SerializedImageProps @@ -193,26 +193,26 @@ export declare module 'fabric' { _drawCroppingPath(ctx: CanvasRenderingContext2D): void } - export declare class Path { + export declare interface Path { mask?: SerializedImageProps } - export declare class IText { + export declare interface IText { renderEffects(type?: string): void } - export declare class Textbox { + export declare interface Textbox { color: string } - export declare class Polygon { + export declare interface Polygon { startStyle: LinePoint endStyle: LinePoint pointMoving(index: number, point: Point): Point } - export declare class Line { + export declare interface Line { setLineMode(value: string, model: 'start' | 'end'): void } @@ -226,13 +226,13 @@ export declare module 'fabric' { | 'fit' export declare type PatternOptions = Partial> - export declare class Pattern { + export declare interface Pattern { constructor(options?: PatternOptions) /** 契合度 */ fit: 'fill' | 'padding' | 'clip' | 'repeat' } - export declare class StaticCanvas { + export declare interface StaticCanvas { _objects: FabricObject[] getObjects(): FabricObject[] } diff --git a/src/mocks/templates.ts b/src/mocks/templates.ts index 29133032..3141c0c2 100644 --- a/src/mocks/templates.ts +++ b/src/mocks/templates.ts @@ -33,7 +33,7 @@ export const Templates: Template[] = [ "width": 1070.5512, "height": 645.3543, "stroke": "", - "strokeWidth": 1, + "strokeWidth": 0, "strokeDashArray": null, "strokeLineCap": "butt", "strokeDashOffset": 0,