Skip to content

Commit

Permalink
dwg fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DomCR committed Nov 25, 2024
1 parent 4fcdd1e commit 5a3bf08
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ACadSharp.Tests/IO/WriterSingleObjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ public void AddCustomScale()

public void AddCustomBookColor()
{
var color = new BookColor("RAL CLASSIC$RAL 1006");
//var color = new BookColor("TEST BOOK$MY COLOR");
//var color = new BookColor("RAL CLASSIC$RAL 1006");
var color = new BookColor("TEST BOOK$MY COLOR");
color.Color = new(226, 144, 0);

Line line = new Line(XYZ.Zero, new XYZ(100, 100, 0));
Expand Down
1 change: 0 additions & 1 deletion src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5798,7 +5798,6 @@ private CadTemplate readDbColor()

if (this.R2004Plus)
{
//3269627904
uint trueColor = (uint)this._objectReader.ReadBitLong();
byte flags = this._objectReader.ReadByte();

Expand Down
6 changes: 1 addition & 5 deletions src/ACadSharp/IO/DWG/DwgStreamWriters/DwgStreamWriterAC18.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public override void WriteEnColor(Color color, Transparency transparency, bool i
//BS : color number: flags + color index
ushort size = 0;

if (color.IsByBlock && transparency.IsByLayer)
if (color.IsByBlock && transparency.IsByLayer && !isBookColor)
{
base.WriteBitShort(0);
return;
Expand All @@ -110,10 +110,6 @@ public override void WriteEnColor(Color color, Transparency transparency, bool i
size = (ushort)(size | 0b10000000000000);
}

//49152
//0b1100000000000000
//0b0100000000000000
//0b1000000000000000
//0x4000: has AcDbColor reference (0x8000 is also set in this case).
if (isBookColor)
{
Expand Down

0 comments on commit 5a3bf08

Please sign in to comment.