• Calculate the conversion rate between the width of an element in different measurement units, based on the current zoom level. The element is expected to be a container element with a "width" attribute.

    Parameters

    • element: Element

      The container HTML element for which the conversion rate should be calculated. This element must have a "width" attribute specifying its width in a different unit.

    • viewerZoom: number

      The current zoom level of the viewer.

    • inverse: boolean = false

      If true, calculates the inverse conversion rate; otherwise, calculates the direct conversion rate. The direct conversion rate converts from the unit specified in the "width" attribute to pixels. The inverse conversion rate converts from pixels to the unit specified in the "width" attribute.

    Returns number

    The conversion rate indicating the relationship between the units.