mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Title block template rendering: minor optimization.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1533 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
parent
e7c9d8cf9a
commit
fd155f90d4
@ -1156,7 +1156,7 @@ void TitleBlockTemplate::render(QPainter &painter, const DiagramContext &diagram
|
|||||||
// draw the titleblock border
|
// draw the titleblock border
|
||||||
painter.drawRect(QRect(0, 0, titleblock_width, titleblock_height));
|
painter.drawRect(QRect(0, 0, titleblock_width, titleblock_height));
|
||||||
|
|
||||||
// run through each inidividual cell
|
// run through each individual cell
|
||||||
for (int j = 0 ; j < rows_heights_.count() ; ++ j) {
|
for (int j = 0 ; j < rows_heights_.count() ; ++ j) {
|
||||||
for (int i = 0 ; i < columns_width_.count() ; ++ i) {
|
for (int i = 0 ; i < columns_width_.count() ; ++ i) {
|
||||||
if (cells_[i][j] -> spanner_cell || cells_[i][j] -> cell_type == TitleBlockCell::EmptyCell) continue;
|
if (cells_[i][j] -> spanner_cell || cells_[i][j] -> cell_type == TitleBlockCell::EmptyCell) continue;
|
||||||
@ -1243,6 +1243,7 @@ QString TitleBlockTemplate::finalTextForCell(const TitleBlockCell &cell, const D
|
|||||||
@param cell_rect Rectangle delimiting the cell area
|
@param cell_rect Rectangle delimiting the cell area
|
||||||
*/
|
*/
|
||||||
void TitleBlockTemplate::renderTextCell(QPainter &painter, const QString &text, const TitleBlockCell &cell, const QRectF &cell_rect) const {
|
void TitleBlockTemplate::renderTextCell(QPainter &painter, const QString &text, const TitleBlockCell &cell, const QRectF &cell_rect) const {
|
||||||
|
if (text.isEmpty()) return;
|
||||||
QFont text_font = TitleBlockTemplate::fontForCell(cell);
|
QFont text_font = TitleBlockTemplate::fontForCell(cell);
|
||||||
painter.setFont(text_font);
|
painter.setFont(text_font);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user