getBBox()

Returns the bounding box of an SVG element.

Syntax

getBBox( cid SMALLINT, id STRING )
     RETURNS t_svg_rect
  1. cid is the SVG canvas id, as returned by fglsvgcanvas.create().
  2. id identifies the SVG element from which the bounding box is got.

Usage

This function returns the bounding box of the SVG element identified by the id parameter.

The values returned are x, y, width and height (in the current user space).

The values returned by getBBox() can be held in a record variable defined with the t_svg_rect type.

If no SVG element is found, the values returned will be NULL.

Example

DEFINE rect fglsvgcanvas.t_svg_rect
...
ON ACTION get_bbox
   CALL fglsvgcanvas.getBBox(cid, "label_23") RETURNING rect.*
   DISPLAY rect.x, rect.y, rect.width, rect.height