Skip to content

Commit

Permalink
Fix QR address display for blinded base58 addrs
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs authored and stevenroose committed Nov 26, 2019
1 parent 59d6b9f commit 615be7f
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit 615be7f

Please sign in to comment.