mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #57493 fabric: Add currentTarget and currentSubTargets to fabric event by @ScottMorse
This commit is contained in:
2
types/fabric/fabric-impl.d.ts
vendored
2
types/fabric/fabric-impl.d.ts
vendored
@@ -179,6 +179,8 @@ interface IEvent<E extends Event = Event> {
|
||||
pointer?: Point | undefined;
|
||||
absolutePointer?: Point | undefined;
|
||||
transform?: { corner: string; original: Object; originX: string; originY: string; width: number } | undefined;
|
||||
currentTarget?: Object | undefined;
|
||||
currentSubTargets?: Object[] | undefined;
|
||||
}
|
||||
|
||||
interface IFillOptions {
|
||||
|
||||
@@ -7,6 +7,10 @@ function sample1() {
|
||||
|
||||
canvas.on('object:moving', (e: fabric.IEvent) => {
|
||||
e.target.opacity = 0.5;
|
||||
e.currentTarget.sendBackwards();
|
||||
e.currentSubTargets.forEach((subTarget) => {
|
||||
subTarget.bringToFront();
|
||||
});
|
||||
});
|
||||
canvas.on('object:modified', (e: fabric.IEvent) => {
|
||||
e.target.opacity = 1;
|
||||
|
||||
Reference in New Issue
Block a user