docs
Loading...
Searching...
No Matches
DOMRect

#include <Ultralight/dom/DOMRect.h>

Overview

A rectangle in CSS pixels, relative to the viewport (DOMRect).

The coordinates are in the same space as event client positions and Document::elementFromPoint().

Note
For an element in a subframe, the viewport is that frame's own viewport.
Note
CSS pixels are device pixels divided by the View's device scale.
See also
Element::getBoundingClientRect(), Range::getBoundingClientRect()

Public Member Functions

double left () const
 Get the left edge (left).
double top () const
 Get the top edge (top).
double right () const
 Get the right edge (right).
double bottom () const
 Get the bottom edge (bottom).

Public Attributes

double x = 0
 The horizontal position.
double y = 0
 The vertical position.
double width = 0
 The width (can be negative).
double height = 0
 The height (can be negative).

Member Function Documentation

◆ bottom()

double bottom ( ) const
inline

Get the bottom edge (bottom).

◆ left()

double left ( ) const
inline

Get the left edge (left).

This is x unless the width is negative.

◆ right()

double right ( ) const
inline

Get the right edge (right).

◆ top()

double top ( ) const
inline

Get the top edge (top).

This is y unless the height is negative.

Member Data Documentation

◆ height

double height = 0

The height (can be negative).

◆ width

double width = 0

The width (can be negative).

◆ x

double x = 0

The horizontal position.

◆ y

double y = 0

The vertical position.


The documentation for this struct was generated from the following file: