mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 06:31:15 +08:00
feat: use GetClientRectConfig interface
This commit is contained in:
parent
2b5a1aa4a3
commit
5e152a0e90
@ -2,7 +2,7 @@ import { Factory } from './Factory';
|
||||
import { Node, NodeConfig } from './Node';
|
||||
import { getNumberValidator } from './Validators';
|
||||
|
||||
import { GetSet, IRect } from './types';
|
||||
import { GetClientRectConfig, GetSet, IRect } from './types';
|
||||
import { Shape } from './Shape';
|
||||
import { HitCanvas, SceneCanvas } from './Canvas';
|
||||
import { SceneContext } from './Context';
|
||||
@ -440,14 +440,7 @@ export abstract class Container<
|
||||
}
|
||||
}
|
||||
|
||||
getClientRect(
|
||||
config: {
|
||||
skipTransform?: boolean;
|
||||
skipShadow?: boolean;
|
||||
skipStroke?: boolean;
|
||||
relativeTo?: Container<Node>;
|
||||
} = {}
|
||||
): IRect {
|
||||
getClientRect(config: GetClientRectConfig = {}): IRect {
|
||||
var skipTransform = config.skipTransform;
|
||||
var relativeTo = config.relativeTo;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import { Context, SceneContext } from './Context';
|
||||
import { _registerNode } from './Global';
|
||||
import * as PointerEvents from './PointerEvents';
|
||||
|
||||
import { GetSet, Vector2d } from './types';
|
||||
import { GetClientRectConfig, GetSet, Vector2d } from './types';
|
||||
import { HitCanvas, SceneCanvas } from './Canvas';
|
||||
|
||||
// hack from here https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types/52668133#52668133
|
||||
@ -82,12 +82,7 @@ export interface ShapeConfig extends NodeConfig {
|
||||
perfectDrawEnabled?: boolean;
|
||||
}
|
||||
|
||||
export interface ShapeGetClientRectConfig {
|
||||
skipTransform?: boolean;
|
||||
skipShadow?: boolean;
|
||||
skipStroke?: boolean;
|
||||
relativeTo?: Node;
|
||||
}
|
||||
export interface ShapeGetClientRectConfig extends GetClientRectConfig {}
|
||||
|
||||
export type FillFuncOutput =
|
||||
| void
|
||||
|
Loading…
Reference in New Issue
Block a user