import { Vector2d } from "../math/vector2d.ts"; import { Polygon } from "./polygon.ts"; /** * a rectangle object with rounded corners * @category Geometry */ export declare class RoundRect extends Polygon { /** * Corner radius. */ _radius: number; /** * stored width */ _width: number; /** * stored height */ _height: number; /** * the shape type (used internally) */ type: string; /** * @param x - position of the rounded rectangle * @param y - position of the rounded rectangle * @param width - the rectangle width * @param height - the rectangle height * @param [radius=20] - the radius of the rounded corner */ constructor(x: number, y: number, width: number, height: number, radius?: number); /** * width of the RoundRect */ get width(): number; set width(value: number); /** * height of the RoundRect */ get height(): number; set height(value: number); /** * left coordinate of the RoundRect */ get left(): number; /** * right coordinate of the RoundRect */ get right(): number; /** * top coordinate of the RoundRect */ get top(): number; /** * bottom coordinate of the RoundRect */ get bottom(): number; /** * absolute center of this RoundRect on the horizontal axis */ get centerX(): number; /** * absolute center of this RoundRect on the vertical axis */ get centerY(): number; /** * the radius of the rounded corner * @default 20 */ get radius(): number; set radius(value: number); /** * Rebuild polygon vertices to approximate the rounded corners. * Reuses existing Vector2d instances when the vertex count matches. * @ignore */ _updateVertices(): void; /** * Set new dimensions for the rounded rectangle. * @param width - The new width. * @param height - The new height. */ setSize(width: number, height: number): this; /** * resize the rounded rectangle * @param w - new width * @param h - new height * @returns this rounded rectangle */ resize(w: number, h: number): this; /** * copy the position, size and radius of the given rounded rectangle into this one * @param rrect - source rounded rectangle * @returns this rounded rectangle */ copy(rrect: RoundRect): this; /** * Returns true if the rounded rectangle contains the given point * @param x - x coordinate or a vector point * @param [y] - y coordinate * @returns True if the rounded rectangle contains the given point */ contains(x: number, y: number): boolean; contains(vector: Vector2d): boolean; /** * Returns true if the rounded rectangle contains the given rectangle * @param rectangle - rectangle to test * @param rectangle.left - left coordinate * @param rectangle.right - right coordinate * @param rectangle.top - top coordinate * @param rectangle.bottom - bottom coordinate * @returns true if contained */ containsRectangle(rectangle: { left: number; right: number; top: number; bottom: number; }): boolean; /** * check if this RoundRect is identical to the specified one * @param rrect - Other rounded rectangle. * @returns true if equals */ equals(rrect: RoundRect): boolean; /** * clone this RoundRect * @returns new RoundRect */ clone(): RoundRect; } export declare const roundedRectanglePool: import("../system/pool.ts").Pool; //# sourceMappingURL=roundrect.d.ts.map