Fix DXF export of circles, arcs and the title block at the right (#1339)

Circles and arcs: drawArcEllipse() split each curve into quarters and
fitted a circular ARC through a point half way between the curve and its
chord, so every circle came out as a flattened diamond. A circle or an
arc of one is now one exact CIRCLE or ARC. R10 has no ELLIPSE entity, so
a true ellipse is a polyline through the curve, one point every 5
degrees. The export also used a different scale on each axis, which made
round things oval; it now uses one, the largest that fits the sheet.

Title block at the right: the DXF laid the horizontal template out in
the narrow vertical strip, squashing it into the top corner. It is now
laid out horizontally and turned a quarter, as draw() turns the painter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-07 08:13:52 +13:00
parent 0708338bce
commit 83f72c95c6
11 changed files with 325 additions and 153 deletions
+17 -4
View File
@@ -708,13 +708,26 @@ void BorderTitleBlock::drawDxf(
// render the titleblock, using the TitleBlockTemplate object
if (display_titleblock_) {
Createdxf::layer = DxfExport::Layer::TitleBlock;
//qp -> translate(titleblock_rect_.topLeft());
QRectF rect = titleBlockRect();
//Laid out horizontally, then turned like the QPainter in
//draw(): a quarter turn counter-clockwise around its top
//left, which for a title block at the right is the bottom
//right of the diagram (issue #1339).
QRectF rect = titleBlockRectForQPainter();
QTransform dxf_transform;
if (m_edge != Qt::BottomEdge)
{
const QPointF pivot(rect.left() * Createdxf::xScale,
Createdxf::sheetHeight
- rect.top() * Createdxf::yScale);
dxf_transform.translate(pivot.x(), pivot.y());
dxf_transform.rotate(90);
dxf_transform.translate(-pivot.x(), -pivot.y());
}
m_titleblock_template_renderer -> renderDxf(rect,
rect.width(),
file_path,
color);
//qp -> translate(-titleblock_rect_.topLeft());
color,
dxf_transform);
}
// Transform back to QET scale