UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

39 lines 2.2 kB
import type { ControlCallback, ControlCursorCallback, TransformActionHandler } from '../EventTypeDefs'; import type { TAxisKey } from '../typedefs'; /** * Inspect event, control and fabricObject to return the correct action name * @param {Event} eventData the javascript event that is causing the scale * @param {Control} control the control that is interested in the action * @param {FabricObject} fabricObject the fabric object that is interested in the action * @return {String} an action name */ export declare const scaleOrSkewActionName: ControlCallback<TAxisKey<'skew' | 'scale'> | ''>; /** * Combine skew and scale style handlers to cover fabric standard use case * @param {Event} eventData the javascript event that is causing the scale * @param {Control} control the control that is interested in the action * @param {FabricObject} fabricObject the fabric object that is interested in the action * @return {String} a valid css string for the cursor */ export declare const scaleSkewCursorStyleHandler: ControlCursorCallback; /** * Composed action handler to either scale X or skew Y * Needs to be wrapped with `wrapWithFixedAnchor` to be effective * @param {Event} eventData javascript event that is doing the transform * @param {Object} transform javascript object containing a series of information around the current transform * @param {number} x current mouse x position, canvas normalized * @param {number} y current mouse y position, canvas normalized * @return {Boolean} true if some change happened */ export declare const scalingXOrSkewingY: TransformActionHandler; /** * Composed action handler to either scale Y or skew X * Needs to be wrapped with `wrapWithFixedAnchor` to be effective * @param {Event} eventData javascript event that is doing the transform * @param {Object} transform javascript object containing a series of information around the current transform * @param {number} x current mouse x position, canvas normalized * @param {number} y current mouse y position, canvas normalized * @return {Boolean} true if some change happened */ export declare const scalingYOrSkewingX: TransformActionHandler; //# sourceMappingURL=scaleSkew.d.ts.map