Beispiel #1
0
        private void PrintGlyph(ColoredGlyph glyph, ColoredString settings)
        {
            var cell = editor.TextSurface.Cells[position.Y * editor.TextSurface.Width + position.X];

            if (!PrintOnlyCharacterData)
            {
                if (!settings.IgnoreGlyph)
                {
                    cell.Glyph = glyph.GlyphCharacter;
                }
                if (!settings.IgnoreBackground)
                {
                    cell.Background = glyph.Background;
                }
                if (!settings.IgnoreForeground)
                {
                    cell.Foreground = glyph.Foreground;
                }
                if (!settings.IgnoreMirror)
                {
                    cell.Mirror = glyph.Mirror;
                }
                if (!settings.IgnoreEffect)
                {
                    editor.SetEffect(cell, glyph.Effect);
                }
            }
            else if (!settings.IgnoreGlyph)
            {
                cell.Glyph = glyph.GlyphCharacter;
            }


            position.X += 1;
            if (position.X >= editor.TextSurface.Width)
            {
                position.X  = 0;
                position.Y += 1;

                if (position.Y >= editor.TextSurface.Height)
                {
                    position.Y -= 1;

                    if (AutomaticallyShiftRowsUp)
                    {
                        editor.ShiftUp();
                    }
                }
            }

            editor.TextSurface.IsDirty = true;
        }