Skip to content

Commit

Permalink
polyline (consistent) width persisted for saving
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixNotTheCat committed Jan 22, 2017
1 parent 5522d0b commit 9c15cbf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions librecad/src/lib/engine/rs_polyline.cpp
Expand Up @@ -39,7 +39,8 @@ RS_PolylineData::RS_PolylineData():
startpoint(false),
endpoint(false),
thickness(0.0),
elevation(0.0)
elevation(0.0),
consistwidth(0.0)
{
}

Expand All @@ -49,7 +50,8 @@ RS_PolylineData::RS_PolylineData(const RS_Vector& _startpoint,
startpoint(_startpoint),
endpoint(_endpoint),
thickness(0.0),
elevation(0.0)
elevation(0.0),
consistwidth(0.0)
{

if (_closed) {
Expand All @@ -63,6 +65,7 @@ std::ostream& operator << (std::ostream& os,
"/" << pd.endpoint <<
", thickness " << pd.thickness <<
", elevation " << pd.elevation <<
", consistwidth " << pd.consistwidth <<
")";
return os;
}
Expand Down
1 change: 1 addition & 0 deletions librecad/src/lib/engine/rs_polyline.h
Expand Up @@ -48,6 +48,7 @@ struct RS_PolylineData : public RS_Flags {
// persist potentially existing polyline data
double thickness;
double elevation;
double consistwidth;
};

std::ostream& operator << (std::ostream& os, const RS_PolylineData& pd);
Expand Down
2 changes: 2 additions & 0 deletions librecad/src/lib/filters/rs_filterdxfrw.cpp
Expand Up @@ -533,6 +533,7 @@ void RS_FilterDXFRW::addLWPolyline(const DRW_LWPolyline& data) {
// persist potentially existing polyline data
d.elevation=data.elevation;
d.thickness=data.thickness;
d.consistwidth=data.width;
RS_Polyline *polyline = new RS_Polyline(currentContainer, d);
setEntityAttributes(polyline, &data);

Expand Down Expand Up @@ -2153,6 +2154,7 @@ void RS_FilterDXFRW::writeLWPolyline(RS_Polyline* l) {
if (l) {
pol.elevation=(l->getData()).elevation;
pol.thickness=(l->getData()).thickness;
pol.width=(l->getData()).consistwidth;
}

for (RS_Entity* e=l->firstEntity(RS2::ResolveNone);
Expand Down

0 comments on commit 9c15cbf

Please sign in to comment.