Sakuno.KanColle.Amatsukaze.Services.Browser.BrowserHost.MeasureOverride C# (CSharp) Method

MeasureOverride() protected method

protected MeasureOverride ( Size rpConstraint ) : Size
rpConstraint System.Windows.Size
return System.Windows.Size
        protected override Size MeasureOverride(Size rpConstraint)
        {
            var rWidth = rpConstraint.Width;
            var rHeight = rpConstraint.Height;

            if (IsExtracted)
            {
                var rZoom = DpiUtil.ScaleX + Preference.Instance.Browser.Zoom - 1.0;

                rWidth = Math.Min(rWidth, GameConstants.GameWidth * rZoom / DpiUtil.ScaleX / DpiUtil.ScaleX);
                rHeight = Math.Min(rHeight, GameConstants.GameHeight * rZoom / DpiUtil.ScaleY / DpiUtil.ScaleY);
            }

            return new Size(rWidth, rHeight);
        }
    }