Interface GettingCanvasSize


public interface GettingCanvasSize

Determining the size of a drawn canvas

A canvas's size is determined by its specified width, height as well as its overflow.

The following methods are available to retrieve the size of a canvas at runtime:

Canvas.getWidth(), Canvas.getHeight()

Returns the specified size of the component in pixels. If height or width were specified as a percentage value, this method will return the resolved absolute size.

Canvas.getInnerWidth(), Canvas.getInnerHeight()

Returns the amount of space available for absolutely positioned child widget(s) or absolutely positioned HTML content, without introducing clipping, scrolling or overflow.

This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size.

Canvas.getInnerContentWidth(), Canvas.getInnerContentHeight()

Returns the amount of space available for relatively positioned child widget(s) or inline positioned HTML content, without introducing clipping, scrolling or overflow.

This is the space within the viewport of the widget (not including padding, excluding margins, borders or scrollbars) rendered at its specified size.

Canvas.getVisibleWidth(), Canvas.getVisibleHeight()

Returns the drawn size of the component in pixels, (including border, margin and scrollbars). If a widget is undrawn or has overflow set to something other than "visible", this will match the value returned by Canvas.getWidth() or Canvas.getHeight(). For an overflow:"visible" canvas this value will be greater than the specified size if the size of children or content exceeds the available space.

Canvas.getViewportWidth(), Canvas.getViewportHeight()

Returns the drawn size of the component's viewport in pixels. This is the same value as Canvas.getVisibleWidth() / Canvas.getVisibleWidth(), less any border, margin or scrollbars

Canvas.getScrollWidth(), Canvas.getScrollHeight()

Returns the scrollable size of the widget's content, including children.

For components with Canvas.overflow set to something other than "visible", this value may exceed the drawn size of the canvas. See also Canvas.getScrollLeft(), Canvas.getScrollTop().