UNPKG

react-fabric-canvas-designer

Version:

A React-based wrapper for Fabric.js to create interactive and customizable canvas-based designs. This library provides tools for drawing, editing, and managing objects on a canvas with React-friendly APIs.

23 lines (21 loc) 749 B
import { FabricImage } from "fabric"; import { bindThisInAllObjFn } from "../helpers/helpers"; import { FabricObjectPropertyList } from "../types/WrapperFabricType"; import { WrapperFabric } from "./WrapperFabric"; export class FabricImageObj extends WrapperFabric { obj: FabricImage; constructor(rectObj: FabricImage) { super(rectObj) this.propertyListMap = { ...this.propertyListMap, "imageFit": this.setImageFit } this.obj = rectObj bindThisInAllObjFn(this, this.propertyListMap) } setImageFit(_: string) { } public getObjectValues(): FabricObjectPropertyList { return { ...super.getObjectValues(), // imageFit: null } } }