drawsvg iconDRAWSVG user's guide

8.3. Bounding box constraint

This type of constraint apply the bounding box of an element to another of type (rectangle, ellipse, circle).

When transforming the element its linked bounding box element is updated.

Conversely, the modification of the bounding box element is carried over to the linked element so as to keep the center and force the dimensions to ensure the inclusion of the element.

Figure 8.4. Bounding box constraint

Bounding box constraint

A bounding box constraint refers two elements (the bounding box element and the target), a margin property can be set.

<defs id="drawsvgConstraints">
	<defs id="constraint1" drawsvg:constraint="{'type':'alignRectToBBox', 'ids':['rect1','e1_texte'], 'priority':0, 'margin':20}"/>

Creating the bounding box of a text is available from the floating menu with "add bounding box" action.

Otherwise the bounding box element (rectangle, ellipse, circle) must first be created then selected with the target element to apply the constraint with the action of the selection / constraints menu.

See showcase bounding box constraint .