Changeset View
Changeset View
Standalone View
Standalone View
ui/pagepainter.cpp
Show First 20 Lines • Show All 689 Lines • ▼ Show 20 Line(s) | 684 | { | |||
---|---|---|---|---|---|
690 | Qt::AlignmentFlag halign = ( text->inplaceAlignment() == 1 ? Qt::AlignHCenter : ( text->inplaceAlignment() == 2 ? Qt::AlignRight : Qt::AlignLeft ) ); | 690 | Qt::AlignmentFlag halign = ( text->inplaceAlignment() == 1 ? Qt::AlignHCenter : ( text->inplaceAlignment() == 2 ? Qt::AlignRight : Qt::AlignLeft ) ); | ||
691 | const double invXScale = (double)page->width() / scaledWidth; | 691 | const double invXScale = (double)page->width() / scaledWidth; | ||
692 | const double invYScale = (double)page->height() / scaledHeight; | 692 | const double invYScale = (double)page->height() / scaledHeight; | ||
693 | const double borderWidth = text->style().width(); | 693 | const double borderWidth = text->style().width(); | ||
694 | painter.scale( 1 / invXScale, 1 / invYScale ); | 694 | painter.scale( 1 / invXScale, 1 / invYScale ); | ||
695 | painter.drawText( borderWidth * invXScale, borderWidth * invYScale, | 695 | painter.drawText( borderWidth * invXScale, borderWidth * invYScale, | ||
696 | (image.width() - 2 * borderWidth) * invXScale, | 696 | (image.width() - 2 * borderWidth) * invXScale, | ||
697 | (image.height() - 2 * borderWidth) * invYScale, | 697 | (image.height() - 2 * borderWidth) * invYScale, | ||
698 | Qt::AlignTop | halign | Qt::TextWrapAnywhere, | 698 | Qt::AlignTop | halign | Qt::TextWordWrap, | ||
699 | text->contents() ); | 699 | text->contents() ); | ||
700 | painter.resetTransform(); | 700 | painter.resetTransform(); | ||
701 | //Required as asking for a zero width pen results | 701 | //Required as asking for a zero width pen results | ||
702 | //in a default width pen (1.0) being created | 702 | //in a default width pen (1.0) being created | ||
703 | if ( borderWidth != 0 ) | 703 | if ( borderWidth != 0 ) | ||
704 | { | 704 | { | ||
705 | QPen pen( Qt::black, borderWidth ); | 705 | QPen pen( Qt::black, borderWidth ); | ||
706 | painter.setPen( pen ); | 706 | painter.setPen( pen ); | ||
▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines |