private void HandleFrameSelected()
{
if (((Event.current.type == EventType.ValidateCommand) || (Event.current.type == EventType.ExecuteCommand)) && (Event.current.commandName == "FrameSelected"))
{
if (Event.current.type == EventType.ExecuteCommand)
{
if (this.selected == null)
{
return;
}
Rect rect = this.selected.m_Rect;
float zoom = base.m_Zoom;
if (rect.width < rect.height)
{
zoom = this.m_TextureViewRect.height / (rect.height + (this.m_TextureViewRect.height * 0.05f));
}
else
{
zoom = this.m_TextureViewRect.width / (rect.width + (this.m_TextureViewRect.width * 0.05f));
}
base.m_Zoom = zoom;
this.m_ScrollPosition.x = (rect.center.x - (base.m_Texture.width * 0.5f)) * base.m_Zoom;
this.m_ScrollPosition.y = ((rect.center.y - (base.m_Texture.height * 0.5f)) * base.m_Zoom) * -1f;
base.Repaint();
}
Event.current.Use();
}
}