Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix QR address display for blinded base58 addrs #785

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/qt/receiverequestdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,13 @@ void ReceiveRequestDialog::update()
split_address.insert((chars_per_line * i) + i, '\n');
}

QImage qrAddrImage = QImage(QR_IMAGE_SIZE, QR_IMAGE_SIZE + 16 + fm.height(), QImage::Format_RGB32);
// Elements: Hack to get QR address to print right
const size_t MORE_WIDTH = 80;

QImage qrAddrImage = QImage(QR_IMAGE_SIZE + MORE_WIDTH, QR_IMAGE_SIZE + 16 + fm.height(), QImage::Format_RGB32);
qrAddrImage.fill(0xffffff);
QPainter painter(&qrAddrImage);
painter.drawImage(0, 0, qrImage.scaled(QR_IMAGE_SIZE, QR_IMAGE_SIZE));
painter.drawImage(MORE_WIDTH/2, 0, qrImage.scaled(QR_IMAGE_SIZE, QR_IMAGE_SIZE));
QRect paddedRect = qrAddrImage.rect();
paddedRect.setHeight(QR_IMAGE_SIZE + 8 + fm.height());
painter.drawText(paddedRect, Qt::AlignBottom | Qt::AlignCenter | Qt::TextWordWrap, split_address);
Expand Down