@visactor/vrender-core
Version:
```typescript import { xxx } from '@visactor/vrender-core'; ```
44 lines (43 loc) • 1.66 kB
TypeScript
import type { IContext2d, IRichTextIcon } from '../../interface';
import type Line from './line';
export default class Frame {
left: number;
top: number;
bottom: number;
right: number;
width: number;
height: number;
actualHeight: number;
ellipsis: boolean | string;
wordBreak: 'break-word' | 'break-all';
verticalDirection: 'top' | 'middle' | 'bottom';
lines: Line[];
globalAlign: 'left' | 'center' | 'right' | 'start' | 'end';
globalBaseline: 'top' | 'middle' | 'bottom';
layoutDirection: 'horizontal' | 'vertical';
directionKey: {
width: string;
height: string;
left: string;
top: string;
bottom: string;
};
isWidthMax: boolean;
isHeightMax: boolean;
singleLine: boolean;
icons: Map<string, IRichTextIcon>;
constructor(left: number, top: number, width: number, height: number, ellipsis: boolean | string, wordBreak: 'break-word' | 'break-all', verticalDirection: 'top' | 'middle' | 'bottom', globalAlign: 'left' | 'center' | 'right' | 'start' | 'end', globalBaseline: 'top' | 'middle' | 'bottom', layoutDirection: 'horizontal' | 'vertical', isWidthMax: boolean, isHeightMax: boolean, singleLine: boolean, icons?: Map<string, IRichTextIcon>);
draw(ctx: IContext2d, drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void): boolean;
getActualSize(): {
width: number;
height: number;
};
getRawActualSize(): {
width: number;
height: number;
};
getActualSizeWidthEllipsis(): {
width: number;
height: number;
};
}