mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[@types/fabric] fix type on getScrollLeftTop (#40780)
* [@types/fabric] fix type on getScrollLeftTop * [@types/fabric] add unit tests.
This commit is contained in:
parent
0d12531ffe
commit
4ed6d134ac
3
types/fabric/fabric-impl.d.ts
vendored
3
types/fabric/fabric-impl.d.ts
vendored
@ -5915,9 +5915,8 @@ interface IUtilDomMisc {
|
||||
/**
|
||||
* Returns element scroll offsets
|
||||
* @param element Element to operate on
|
||||
* @param upperCanvasEl Upper canvas element
|
||||
*/
|
||||
getScrollLeftTop(element: HTMLElement, upperCanvasEl: HTMLElement): { left: number; right: number; };
|
||||
getScrollLeftTop(element: HTMLElement): { left: number; top: number; };
|
||||
/**
|
||||
* Returns offset for a given element
|
||||
* @param element Element to get offset for
|
||||
|
||||
@ -1041,3 +1041,10 @@ function sample11() {
|
||||
const webglFilterBackend = new fabric.WebglFilterBackend();
|
||||
fabric.filterBackend = new fabric.Canvas2dFilterBackend();
|
||||
}
|
||||
|
||||
function sample12() {
|
||||
const canvas = new fabric.Canvas('c');
|
||||
const position = fabric.util.getScrollLeftTop(canvas.getElement());
|
||||
const x = position.left;
|
||||
const y = position.top;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user