Files
game-cards-poker-design/frontend/node_modules/fabric/dist-extensions/extensions/cropping_controls/croppingHandlers.d.ts
Poker Design Developer 5dbcebf7a2 Fix frontend blank page issues
- Fix router import path in main.js
- Handle Django REST Framework pagination format in API calls
- Add getTemplates function to project API
- Restart frontend development server
2026-05-31 18:40:56 +08:00

55 lines
3.0 KiB
TypeScript

import type { TransformActionHandler, FabricImage, ObjectEvents, Control, TMat2D } from 'fabric';
import { Point } from 'fabric';
/**
* Wraps a handler to swap behavior based on flip state.
*/
export declare const withFlip: (handler: TransformActionHandler, flippedHandler: TransformActionHandler, axis: "flipX" | "flipY") => TransformActionHandler;
/**
* Wraps corner handlers to swap both X and Y behavior based on flip state.
*/
export declare const withCornerFlip: (xHandler: TransformActionHandler, xFlippedHandler: TransformActionHandler, yHandler: TransformActionHandler, yFlippedHandler: TransformActionHandler) => TransformActionHandler;
/**
* Wrap controlsUtils.changeObjectWidth with image constrains
*/
export declare const changeImageWidth: TransformActionHandler;
export declare const changeCropWidth: TransformActionHandler<import("fabric").Transform>;
/**
* Wrap controlsUtils.changeObjectHeight with image constrains
*/
export declare const changeImageHeight: TransformActionHandler;
export declare const changeCropHeight: TransformActionHandler<import("fabric").Transform>;
export declare const changeImageCropX: TransformActionHandler;
export declare const changeImageCropY: TransformActionHandler;
export declare const changeCropX: TransformActionHandler<import("fabric").Transform>;
export declare const changeCropY: TransformActionHandler<import("fabric").Transform>;
/**
* A function to counter the move action and change cropX/cropY of an image
* Keep the image steady, but moves it inside its own cropping rectangle
*/
export declare const cropPanMoveHandler: ({ transform }: ObjectEvents["moving"]) => void;
/**
* This position handler works only for this specific use case.
* It does not support padding nor offset, and it reduces all possible positions
* to the main 4 corners only.
* Any position that is < 0 is the extreme left/top, the rest are right/bottom
*/
export declare function ghostScalePositionHandler(this: Control, dim: Point, // currentDimension
finalMatrix: TMat2D, fabricObject: FabricImage): Point;
/**
* Reflects pointer position across object center when image is flipped.
* This compensates for the inverted local coordinate system.
*/
/**
* Action handler generator that handles scaling of an image in crop mode.
* The goal is to keep the current bounding box steady.
* So this action handler has its own calculations for a dynamic anchor point
*/
export declare const scaleEquallyCropGenerator: (cx: number, cy: number) => TransformActionHandler;
export declare function renderGhostImage(this: FabricImage, { ctx }: {
ctx: CanvasRenderingContext2D;
}): void;
export declare const changeImageWidthWithAutoCover: TransformActionHandler;
export declare const changeImageHeightWithAutoCover: TransformActionHandler;
export declare const changeWidthAndScaleToCover: TransformActionHandler<import("fabric").Transform>;
export declare const changeHeightAndScaleToCover: TransformActionHandler<import("fabric").Transform>;
//# sourceMappingURL=croppingHandlers.d.ts.map