Click or drag to resize

GH_ViewportSolveUnit Method

Utility function for calculating graphics dimensions in a zoom-aware environment. This function can be used for example to compute the linewidth of a pen which always needs to appear as 3 pixels thick on the screen regardless of zoom values.

Namespace:  Grasshopper.GUI.Canvas
Assembly:  Grasshopper (in Grasshopper.dll)
Syntax
public float SolveUnit(
	float desired,
	float no_less_than,
	float no_more_than
)

Parameters

desired
Type: SystemSingle
Desired value in pixel units.
no_less_than
Type: SystemSingle
Minimum allowed size in graphics coordinates.
no_more_than
Type: SystemSingle
Maximum allowed size in graphics coordinates.

Return Value

Type: Single
See Also