GH_ViewportLimitUnit Method |
Utility function for calculating pixel dimensions in a zoom-aware environment.
The desired value is put through the zoom projection and if the resulting
size (as displayed on the screen) exceeds the visual limits it is clipped.
This function can be used for example to make sure that a certain penwidth
never exceeds visual limits (i.e. it doesn't get too thin or too thick on the screen).
Namespace:
Grasshopper.GUI.Canvas
Assembly:
Grasshopper (in Grasshopper.dll)
Syntax public float LimitUnit(
float guide_value,
float no_less_than = -3.402823E+38f,
float no_more_than = 3.402823E+38f
)
Public Function LimitUnit (
guide_value As Single,
Optional no_less_than As Single = -3.402823E+38F,
Optional no_more_than As Single = 3.402823E+38F
) As Single
Parameters
- guide_value
- Type: SystemSingle
Initial value. - no_less_than (Optional)
- Type: SystemSingle
Minimum allowed visible size on screen. - no_more_than (Optional)
- Type: SystemSingle
Maximum allowed visible size on screen.
Return Value
Type:
SingleSee Also