AGS.Editor.CharactersEditorFilter.GetCharacterRect C# (CSharp) Метод

GetCharacterRect() приватный Метод

private GetCharacterRect ( AGS.Types.Character character, int scale, RoomEditorState state ) : Rectangle
character AGS.Types.Character
scale int
state RoomEditorState
Результат System.Drawing.Rectangle
        private Rectangle GetCharacterRect(Character character, int scale, RoomEditorState state)
        {
            AgsView view = _game.FindViewByID(character.NormalView);
            int xPos = AdjustXCoordinateForWindowScroll(character.StartX, state);// character.StartX* scale;
            int yPos = AdjustYCoordinateForWindowScroll(character.StartY, state);// character.StartY* scale;

            if (view == null || view.Loops.Count == 0)
            {
                return new Rectangle(xPos - 5, yPos - 5, 10, 10);
            }

            int spriteNum = 0;
            if (view.Loops[0].Frames.Count > 0)
                spriteNum = _game.FindViewByID(character.NormalView).Loops[0].Frames[0].Image;
            int spriteWidth = GetSpriteWidthForGameResolution(spriteNum) * scale;// Factory.NativeProxy.GetRelativeSpriteWidth(spriteNum) * scale;
            int spriteHeight = GetSpriteHeightForGameResolution(spriteNum) * scale; // Factory.NativeProxy.GetRelativeSpriteHeight(spriteNum) * scale;
            return new Rectangle(xPos - spriteWidth / 2, yPos - spriteHeight, spriteWidth, spriteHeight);
        }