# Keep Aspect
This plugin add the method .keepAspect()
to line
and text
object. When the SVG is resized this method allows
keeping the initial stroke size for lines and the font size for texts. The plugin transform lines and texts and keep
initial aspect.
The plugin is loaded with:
import gySVG from 'https://cdn.graphery.online/svg/1.0.0/module/index.js';
import keepAspect from 'https://cdn.graphery.online/svg/1.0.0/module/keep-aspect.plugin.js';
gySVG.extend (keepAspect);
When the SVG is resized, the line element keeps the stroke dimension referred to the initial viewBox
. The line length
change with the new dimensions.
When the SVG is resized, the text element keeps the initial height and width. As a result, it keeps its aspect. The text is displayed in a new position, but with same size.