diff --git a/sources/bordertitleblock.h b/sources/bordertitleblock.h index d13abad09..28da7360c 100644 --- a/sources/bordertitleblock.h +++ b/sources/bordertitleblock.h @@ -73,6 +73,8 @@ class BorderTitleBlock : public QObject return(rows_count_ * rows_height_); } /// @return la rows header width, in pixels qreal rowsHeaderWidth() const { return(rows_header_width_); } + /// @return the edge where title block is docked + Qt::Edge titleBlockEdge() const { return(m_edge); } // border - title block = diagram /** diff --git a/sources/print/projectprintwindow.cpp b/sources/print/projectprintwindow.cpp index d064ba574..83b9d4b75 100644 --- a/sources/print/projectprintwindow.cpp +++ b/sources/print/projectprintwindow.cpp @@ -454,8 +454,11 @@ QRect ProjectPrintWindow::diagramRect(Diagram *diagram, const ExportProperties & { auto diagram_rect = diagram->border_and_titleblock.borderAndTitleBlockRect(); if (!option.draw_titleblock) { - auto titleblock_height = diagram->border_and_titleblock.titleBlockRect().height(); - diagram_rect.setHeight(diagram_rect.height() - titleblock_height); + auto titleblock_rect = diagram->border_and_titleblock.titleBlockRect(); + if (diagram->border_and_titleblock.titleBlockEdge() == Qt::BottomEdge) + diagram_rect.setHeight(diagram_rect.height() - titleblock_rect.height()); + else + diagram_rect.setWidth(diagram_rect.width() - titleblock_rect.width()); } //Adjust the border of diagram to 1px (width of the line)