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