How to scale the content of ScrollView without affecting the clipping?

I report this bug. But it says it’s by design. Then how can I achieve this? And it actually breaks my editor plugin.
Previously, I can use the code below to achieve that. But I can’t since 2017.1.0b7.

GUIUtility.ScaleAroundPivot(Vector2.one * scale, Vector2.zero);
position.size /= scale.
GUI.BeginScrollView(position, m_ScrollPosition, viewRect, GUIStyle.None, GUIStyle.None);

Hi,

There was a change in the GUI clipping behavior that made your code work in 2017.1.0b2, but this change was reverted in 2017.1.0b7 because of other regressions that was caused by it.

This is a limitation of the EditorWindow, which does a BeginGroup() to clip the content of the dock area. There is a workaround though, you can first do a EndGroup() before drawing your scaled content. This will bring you in “unclipped space”. After drawing drawing your content, you reset the initial clipping with a BeginGroup().

You can find a blog post about the technique here:

Hope this helps!

1 Like