mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-11 21:53:14 +02:00
Merge pull request #485 from ispyisail/fix-cli-pdf-grid
CLI export: don't draw the editor grid in PDF/PNG/SVG output
This commit is contained in:
@@ -74,9 +74,13 @@ QString diagramStem(Diagram *diagram, int index)
|
|||||||
void renderDiagram(Diagram *diagram, QPainter &painter, const QRectF &target)
|
void renderDiagram(Diagram *diagram, QPainter &painter, const QRectF &target)
|
||||||
{
|
{
|
||||||
const QRect source = diagramRect(diagram);
|
const QRect source = diagramRect(diagram);
|
||||||
const bool was_drawing_grid = false; // export without the editor grid
|
// Export without the editor grid: drawBackground() only paints it when
|
||||||
Q_UNUSED(was_drawing_grid)
|
// draw_grid_ is set (default true), so toggle it off around the render
|
||||||
|
// and restore it afterwards.
|
||||||
|
const bool was_drawing_grid = diagram->displayGrid();
|
||||||
|
diagram->setDisplayGrid(false);
|
||||||
diagram->render(&painter, target, source, Qt::KeepAspectRatio);
|
diagram->render(&painter, target, source, Qt::KeepAspectRatio);
|
||||||
|
diagram->setDisplayGrid(was_drawing_grid);
|
||||||
}
|
}
|
||||||
|
|
||||||
int exportPdf(QETProject &project, const QString &output)
|
int exportPdf(QETProject &project, const QString &output)
|
||||||
|
|||||||
Reference in New Issue
Block a user