<commit_before>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Draw2D.Core.Renderers;

namespace Draw2D.Core.Shapes
{
    public class PathShape : ConnectableShape, ICopyable<PathShape>
    {
        private ObservableCollection<FigureShape> _figures;
        private PathFillRule _fillRule;

        public ObservableCollection<FigureShape> Figures
        {
            get => _figures;
            set => Update(ref _figures, value);
        }

        public PathFillRule FillRule
        {
            get => _fillRule;
            set => Update(ref _fillRule, value);
        }

        public PathShape()
            : base()
        {
            _figures = new ObservableCollection<FigureShape>();
        }

        public PathShape(ObservableCollection<FigureShape> figures)
            : base()
        {
            this.Figures = figures;
        }

        public PathShape(string name)
            : this()
        {
            this.Name = name;
        }

        public PathShape(string name, ObservableCollection<FigureShape> figures)
            : base()
        {
            this.Name = name;
            this.Figures = figures;
        }

        public override IEnumerable<PointShape> GetPoints()
        {
            foreach (var point in Points)
            {
                yield return point;
            }

            foreach (var figure in Figures)
            {
                foreach (var point in figure.GetPoints())
                {
                    yield return point;
                }
            }
        }

        public override void Draw(object dc, ShapeRenderer r, double dx, double dy)
        {
            base.BeginTransform(dc, r);

            var isPathSelected = r.Selected.Contains(this);

            if (Style != null)
            {
                r.DrawPath(dc, this, Style, dx, dy);
            }

            foreach (var figure in Figures)
            {
                Draw(dc, r, dx, dy, figure, isPathSelected);
            }

            base.Draw(dc, r, dx, dy);
            base.EndTransform(dc, r);<commit_msg>Update PathShape.cs<commit_after>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Draw2D.Core.Renderers;

namespace Draw2D.Core.Shapes
{
    public class PathShape : ConnectableShape, ICopyable<PathShape>
    {
        private ObservableCollection<FigureShape> _figures;
        private PathFillRule _fillRule;

        public ObservableCollection<FigureShape> Figures
        {
            get => _figures;
            set => Update(ref _figures, value);
        }

        public PathFillRule FillRule
        {
            get => _fillRule;
            set => Update(ref _fillRule, value);
        }

        public PathShape()
            : base()
        {
            _figures = new ObservableCollection<FigureShape>();
        }

        public PathShape(ObservableCollection<FigureShape> figures)
            : base()
        {
            this.Figures = figures;
        }

        public PathShape(string name)
            : this()
        {
            this.Name = name;
        }

        public PathShape(string name, ObservableCollection<FigureShape> figures)
            : base()
        {
            this.Name = name;
            this.Figures = figures;
        }

        public override IEnumerable<PointShape> GetPoints()
        {
            foreach (var point in Points)
            {
                yield return point;
            }

            foreach (var figure in Figures)
            {
                foreach (var point in figure.GetPoints())
                {
                    yield return point;
                }
            }
        }

        public override void Invalidate(ShapeRenderer r)
        {
            base.Invalidate(r);

            if (this.IsDirty)
            {
                r.InvalidateCache(this);
                this.IsDirty = false;
            }

            foreach (var figure in Figures)
            {
                figure.Invalidate(r);
            }
        }

        public override void Draw(object dc, ShapeRenderer r, double dx, double dy)
        {
            base.BeginTransform(dc, r);

            var isPathSelected = r.Selected.Contains(this);

            if (Style != null)
            {
                r.DrawPath(dc, this, Style, dx, dy);
            }

            foreach (var figure in Figures)
            {
                Draw(dc, r, dx, dy, figure, isPathSelected);
            }

            base.Draw(dc, r, dx, dy);
            base.EndTransform(dc, r);
{'fraction_non_alphanumeric': 0.08368794326241134, 'fraction_numerical': 0.0008105369807497467, 'mean_word_length': 1.4471988101140307, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '652637', 'n_tokens_mistral': 1265, 'n_tokens_neox': 1201, 'n_words': 329}