Skip to content

Commit

Permalink
Allow the "RELATION" constraint to be styled. Try to export it in DXFs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruevs committed Jun 26, 2024
1 parent 98ee731 commit d5b2f53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/drawconstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void Constraint::DoLabel(Canvas *canvas, Canvas::hStroke hcs,
// By default, the reference is from the center; but the style could
// specify otherwise if one is present, and it could also specify a
// rotation.
if(type == Type::COMMENT && disp.style.v) {
if(((type == Type::COMMENT) || (type == Type::RELATION)) && disp.style.v) {
Style *st = Style::Get(disp.style);
// rotation first
double rads = st->textAngle*PI/180;
Expand Down Expand Up @@ -1350,7 +1350,7 @@ void Constraint::GetReferencePoints(const Camera &camera, std::vector<Vector> *r
}

bool Constraint::IsStylable() const {
if(type == Type::COMMENT) return true;
if((type == Type::COMMENT) || (type == Type::RELATION)) return true;
return false;
}

Expand Down
2 changes: 2 additions & 0 deletions src/exportvector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ class DxfWriteInterface : public DRW_Interface {
break;
}

case Constraint::Type::RELATION:
case Constraint::Type::COMMENT: {
Style *st = SK.style.FindById(c.GetStyle());
writeText(xfrm(c.disp.offset), c.Label(),
Expand Down Expand Up @@ -605,6 +606,7 @@ bool DxfFileWriter::NeedToOutput(Constraint *c) {
case Constraint::Type::DIAMETER:
case Constraint::Type::ANGLE:
case Constraint::Type::COMMENT:
case Constraint::Type::RELATION:
return c->IsVisible();

default: // See writeEntities().
Expand Down

0 comments on commit d5b2f53

Please sign in to comment.