Improve code style, Wrap code for better readability

This commit is contained in:
Simon De Backer
2020-08-16 14:26:40 +02:00
parent c4bf492616
commit 41cef49453
16 changed files with 128 additions and 101 deletions

View File

@@ -399,8 +399,12 @@ void ExportDialog::generateSvg(Diagram *diagram, int width, int height, bool kee
@param keep_aspect_ratio True pour conserver le ratio, false sinon
@param io_device Peripherique de sortie pour le code DXF (souvent : un fichier)
*/
void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool keep_aspect_ratio, QString &file_path) {
saveReloadDiagramParameters(diagram, true);
void ExportDialog::generateDxf(Diagram *diagram,
int width,
int height,
bool keep_aspect_ratio,
QString &file_path) {
saveReloadDiagramParameters(diagram, true);
width -= 2*Diagram::margin;
height -= 2*Diagram::margin;
@@ -411,12 +415,22 @@ void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool kee
Createdxf::dxfBegin(file_path);
//Add project elements (lines, rectangles, circles, texts) to dxf file
if (epw -> exportProperties().draw_border) {
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);
if (epw -> exportProperties().draw_border) {
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);
// Build the lists of elements.
QList<Element *> list_elements;
@@ -651,7 +665,11 @@ void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool kee
saveReloadDiagramParameters(diagram, false);
}
QPointF ExportDialog::rotation_transformed(qreal px, qreal py , qreal origin_x, qreal origin_y, qreal angle) {
QPointF ExportDialog::rotation_transformed(qreal px,
qreal py,
qreal origin_x,
qreal origin_y,
qreal angle) {
angle *= -3.14159265 / 180;