Package: gdk

Function gdk:paintable-intrinsic-aspect-ratio

Lambda List

gdk:paintable-intrinsic-aspect-ratio (paintable)

Arguments

paintable -- a gdk:paintable object

Return Value

The double float with the intrinsic aspect ratio of paintable or 0 if none.

Details

Gets the preferred aspect ratio the paintable would like to be displayed at. The aspect ratio is the width divided by the height, so a value of 0.5 means that the paintable prefers to be displayed twice as high as it is wide. Consumers of this interface can use this to preserve aspect ratio when displaying the paintable.

This is a purely informational value and does not in any way limit the values that may be passed to the gdk:paintable-snapshot function.

Usually when a paintable returns nonzero values from the gdk:paintable-intrinsic-width and gdk:paintable-intrinsic-height functions the aspect ratio should conform to those values, though that is not required.

If the paintable does not have a preferred aspect ratio, it returns 0. Negative values are never returned.
 

See also

2024-5-5