# CenterRectUsingSingleLineHeight(ref Rect)

> Modifies the input rect so it is centered and have a height equal to EditorGUIUtility.singleLineHeight.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.IMGUI.Controls](/engine/6000.5/script-reference/unityeditor/imgui/controls.md)
* **Assembly:** UnityEditor.CoreModule

## CenterRectUsingSingleLineHeight(Rect)

```csharp
protected void CenterRectUsingSingleLineHeight(ref Rect rect)
```

### Parameters

**** (\[Rect]\(/engine/6000.5/script-reference/unityengine/rect)): Rect to be modified and centered.

### Remarks

This method can be used in [TreeView\<TIdentifier>.RowGUI](/engine/6000.5/script-reference/unityeditor/imgui/controls/treeview1/rowgui.md) for centering and adjusting the row rect using [EditorGUIUtility.singleLineHeight](/engine/6000.5/script-reference/unityeditor/editorguiutility/singlelineheight.md). In general it is a good idea to use a rect with [EditorGUIUtility.singleLineHeight](/engine/6000.5/script-reference/unityeditor/editorguiutility/singlelineheight.md) for labels and controls if working with row heights larger than the default row height.

Additional Resources: ::RowGUI.
