Skip to content

Commit

Permalink
更新导出,移动bug
Browse files Browse the repository at this point in the history
  • Loading branch information
more-strive committed Oct 1, 2024
1 parent 0903a0a commit d49e1a0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
2,适配稿定设计pdf还原,支持导入psd还原
3,可导出图片,svg,pdf
<b>Demo:[https://yft.design](https://yft.design)</b>
<b>Demo:[https://pro.yft.design](https://pro.yft.design)</b>
<b>Demo:[https://pro.yft.design](https://pro.yft.design/editor)</b>
[介绍文章](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&timestamp=1719707202&unique_k=Z8LQOMT&up_id=149041192)

Expand Down
2 changes: 1 addition & 1 deletion src/app/fabricCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 12 additions & 12 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export declare module 'fabric' {
// on<K extends keyof EventSpec, E extends EventSpec[K]>(handlers: EventRegistryObject<K, E>): VoidFunction;
}

export declare class Canvas {
export declare interface Canvas {
__targetlessCanvasDrag?: boolean
_objects: FabricObject[]
ref: {
Expand All @@ -122,15 +122,15 @@ export declare module 'fabric' {
fire<T>(eventName: EventName, options?: any): T;
}

export declare class ActiveSelection {
export declare interface ActiveSelection {
multiSelectAdd(...targets: FabricObject[]): void
getObjects(...types: string[]): FabricObject[]
forEachObject(
callback: (object: FabricObject, index: number, array: FabricObject[]) => any,
): void
}

export declare class Group {
export declare interface Group {
id: string
name: string
canvas: Canvas | undefined
Expand All @@ -150,7 +150,7 @@ export declare module 'fabric' {
doubleClickHandler(e: TPointerEventInfo<TPointerEvent>): void
}

export declare class FabricObject {
export declare interface FabricObject {
group: Group | undefined
id: string
name: string
Expand Down Expand Up @@ -180,7 +180,7 @@ export declare module 'fabric' {
hideOnLayer: boolean /** 在图层上隐藏 */
}

export declare class FabricImage {
export declare interface FabricImage {
originSrc?: string
effects?: EffectItem[]
mask?: SerializedImageProps
Expand All @@ -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
}

Expand All @@ -226,13 +226,13 @@ export declare module 'fabric' {
| 'fit'
export declare type PatternOptions = Partial<Pick<Pattern, ExportedKeys>>

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[]
}
Expand Down
2 changes: 1 addition & 1 deletion src/mocks/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d49e1a0

Please sign in to comment.