Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text rotation fix #203

Merged
merged 4 commits into from
Nov 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions ACadSharp/Entities/TextEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,7 @@ public string Value
/// The rotation angle in radians.
/// </value>
[DxfCodeValue(DxfReferenceType.IsAngle, 50)]
public double Rotation
{
get => _rotation;
set
{
_rotation = value;
this.AlignmentPoint = new XYZ(Math.Cos(_rotation), Math.Sin(_rotation), 0.0);
}
}
public double Rotation { get; set; }

/// <summary>
/// Relative X scale factor—widt
Expand Down Expand Up @@ -156,15 +148,7 @@ public TextStyle Style
/// This value is meaningful only if the value of a 72 or 73 group is nonzero (if the justification is anything other than baseline/left)
/// </remarks>
[DxfCodeValue(DxfReferenceType.Optional, 11, 21, 31)]
public XYZ AlignmentPoint
{
get => _alignmentPoint;
set
{
_alignmentPoint = value;
this._rotation = new XY(this._alignmentPoint.X, this._alignmentPoint.Y).GetAngle();
}
}
public XYZ AlignmentPoint { get; set; }

/// <summary>
/// Specifies the three-dimensional normal unit vector for the object.
Expand All @@ -182,10 +166,6 @@ public XYZ AlignmentPoint

private double _height = 0.0;

private XYZ _alignmentPoint = XYZ.Zero;

private double _rotation = 0.0;

private TextStyle _style = TextStyle.Default;

public TextEntity() : base() { }
Expand Down
Loading