• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DomCR / ACadSharp / 17737836230

15 Sep 2025 03:12PM UTC coverage: 2.092% (-76.2%) from 78.245%
17737836230

push

github

web-flow
Merge pull request #790 from DomCR/addflag-refactor

addflag refactor

141 of 9225 branches covered (1.53%)

Branch coverage included in aggregate %.

0 of 93 new or added lines in 10 files covered. (0.0%)

24910 existing lines in 372 files now uncovered.

724 of 32119 relevant lines covered (2.25%)

5.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ACadSharp/Objects/Scale.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3

4
namespace ACadSharp.Objects
5
{
6
        /// <summary>
7
        /// Represents a <see cref="Scale"/> object
8
        /// </summary>
9
        /// <remarks>
10
        /// Object name <see cref="DxfFileToken.ObjectScale"/> <br/>
11
        /// Dxf class name <see cref="DxfSubclassMarker.Scale"/>
12
        /// </remarks>
13
        [DxfName(DxfFileToken.ObjectScale)]
14
        [DxfSubClass(DxfSubclassMarker.Scale)]
15
        public class Scale : NonGraphicalObject
16
        {
17
                public static Scale Default { get { return new Scale { Name = "1:1", PaperUnits = 1.0, DrawingUnits = 1.0, IsUnitScale = true }; } }
×
18

19
                /// <inheritdoc/>
UNCOV
20
                public override ObjectType ObjectType { get { return ObjectType.UNLISTED; } }
×
21

22
                /// <inheritdoc/>
UNCOV
23
                public override string ObjectName => DxfFileToken.ObjectScale;
×
24

25
                /// <inheritdoc/>
26
                public override string SubclassMarker => DxfSubclassMarker.Scale;
×
27

28
                /// <summary>
29
                /// Name
30
                /// </summary>
31
                [DxfCodeValue(300)]
32
                public override string Name
33
                {
34
                        get
UNCOV
35
                        {
×
UNCOV
36
                                return base.Name;
×
UNCOV
37
                        }
×
38
                        set
UNCOV
39
                        {
×
UNCOV
40
                                base.Name = value;
×
UNCOV
41
                        }
×
42
                }
43

44
                /// <summary>
45
                /// Group description.
46
                /// </summary>
47
                [DxfCodeValue(140)]
UNCOV
48
                public double PaperUnits { get; set; }
×
49

50
                /// <summary>
51
                /// Group description.
52
                /// </summary>
53
                [DxfCodeValue(141)]
UNCOV
54
                public double DrawingUnits { get; set; }
×
55

56
                /// <summary>
57
                /// Group description.
58
                /// </summary>
59
                [DxfCodeValue(290)]
UNCOV
60
                public bool IsUnitScale { get; set; }
×
61

62
                public double ScaleFactor => this.PaperUnits / this.DrawingUnits;
×
63

UNCOV
64
                public Scale() { }
×
65

UNCOV
66
                public Scale(string name) : base(name)
×
UNCOV
67
                {
×
UNCOV
68
                }
×
69

70
                public double ApplyTo(double value)
71
                {
×
72
                        return value * ScaleFactor;
×
73
                }
×
74

75
                public T ApplyTo<T>(T value)
76
                        where T : IVector, new()
77
                {
×
78
                        T result = new();
×
79

80
                        for (int i = 0; i < value.Dimension; i++)
×
81
                        {
×
82
                                result[i] = ApplyTo(value[i]);
×
83
                        }
×
84

85
                        return result;
×
86
                }
×
87
        }
88
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc