MarginPercent Class

Specifies margins to apply around a view volume for methods like ViewState.lookAtVolume and Viewport.zoomToElements, expanding the viewed volume by a percentage of its original size to add extra space around one or more edges. The margin values represent a fraction of the view volume's width (for MarginPercent.left and MarginPercent.right) or height (for MarginPercent.top and MarginPercent.bottom). The values are clamped to the range 0 through 0.25.

note Margins are only applied in 2d views, or 3d views in which the camera has been turned off.

note The way in which the extra space is computed is somewhat unintuitive and may lead to surprising results.

see MarginOptions.marginPercent.

see PaddingPercent for a more predictable way of adjusting the viewed volume.

extensions

Methods

Name Description
constructor(left: number, top: number, right: number, bottom: number): MarginPercent    

Properties

Name Type Description
bottom number    
left number    
right number    
top number    

Defined in

Last Updated: 20 June, 2023