Fix dxf export for border

This commit is contained in:
David Varley
2020-08-16 15:39:20 +10:00
parent 02afb6c003
commit ddc2afa427
3 changed files with 16 additions and 14 deletions

View File

@@ -652,11 +652,11 @@ void BorderTitleBlock::drawDxf(
if (display_border_ &&
display_columns_) {
for (int i = 1 ; i <= columns_count_ ; ++ i) {
double xCoord = diagram_rect_.topLeft().x() +
double xCoord = diagram_rect_.topLeft().x() * Createdxf::xScale +
(rows_header_width_ + ((i - 1) *
columns_width_));
double yCoord = Createdxf::sheetHeight
- diagram_rect_.topLeft().y()
- diagram_rect_.topLeft().y()*Createdxf::yScale
- columns_header_height_;
double recWidth = columns_width_;
double recHeight = columns_header_height_;
@@ -665,27 +665,27 @@ void BorderTitleBlock::drawDxf(
if (settings.value("border-columns_0", true).toBool()){
Createdxf::drawTextAligned(file_path,
QString::number(i - 1),
xCoord,
yCoord + recHeight*0.5,
xCoord+recWidth/4,
yCoord + recHeight*0.2,
recHeight*0.7,
0,
0,
1,
2,
xCoord+recWidth/2,
xCoord+recWidth/2,
color,
0);
}else{
Createdxf::drawTextAligned(file_path,
QString::number(i),
xCoord,
yCoord + recHeight*0.5,
xCoord+recWidth/4,
yCoord + recHeight*0.2,
recHeight*0.7,
0,
0,
1,
2,
xCoord+recWidth/2,
xCoord+recWidth/2,
color,
0);
}
@@ -699,8 +699,8 @@ void BorderTitleBlock::drawDxf(
for (int i = 1 ; i <= rows_count_ ; ++ i) {
double xCoord = diagram_rect_.topLeft().x()
* Createdxf::xScale;
double yCoord = Createdxf::sheetHeight
- diagram_rect_.topLeft().y()
double yCoord = Createdxf::sheetHeight
- diagram_rect_.topLeft().y()
*Createdxf::yScale
- (
columns_header_height_
@@ -713,8 +713,8 @@ void BorderTitleBlock::drawDxf(
recWidth, recHeight, color);
Createdxf::drawTextAligned(file_path,
row_string,
xCoord,
yCoord + recHeight*0.5,
xCoord+recWidth*0.1,
yCoord + recHeight*0.4,
recWidth*0.7,
0,
0,

View File

@@ -412,7 +412,9 @@ void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool kee
//Add project elements (lines, rectangles, circles, texts) to dxf file
if (epw -> exportProperties().draw_border) {
Createdxf::drawRectangle(file_path, 0, 0, double(width)*Createdxf::xScale, double(height)*Createdxf::yScale, 0);
double bx0 = Diagram::margin * Createdxf::xScale;
double by0 = Diagram::margin * Createdxf::yScale;
Createdxf::drawRectangle(file_path, bx0, -by0, double(width)*Createdxf::xScale, double(height)*Createdxf::yScale, 0);
}
diagram -> border_and_titleblock.drawDxf(width, height, keep_aspect_ratio, file_path, 0);

View File

@@ -1528,7 +1528,7 @@ void TitleBlockTemplate::renderDxf(QRectF &title_block_rect,
QList<int> widths = columnsWidth(titleblock_width);
// draw the titleblock border
double xCoord = title_block_rect.topLeft().x();
double xCoord = title_block_rect.topLeft().x()*Createdxf::xScale;
double yCoord =
Createdxf::sheetHeight
- title_block_rect.bottomLeft().y()