fabric-warpvas
Version:
This JavaScript library helps you efficiently build image warping tools on Fabric.js
17 lines (16 loc) • 527 B
TypeScript
import { fabric } from 'fabric';
/**
* 计算某个点位相对于 Fabric.js 特定对象的坐标位置
*
* @param position - 要转换的位置
* @property {number} [left=0] - 相对于画布左边的距离
* @property {number} [top=0] - 相对于画布顶部的距离
*
* @param target - 目标 Fabric.js 对象
*
* @returns {fabric.Point} 转换后的相对坐标点
*/
export declare const calcFabricRelativeCoord: (position: {
left?: number;
top?: number;
}, target: fabric.Object) => fabric.Point;