From 9024006ca81ec35c722635981ab96416d79e6c29 Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Thu, 27 Oct 2016 22:34:57 +0100 Subject: [PATCH] Display MaxiCode at a suitable size in Studio This is a quick hack - the QT code needs an overhaul --- backend_qt4/qzint.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/backend_qt4/qzint.cpp b/backend_qt4/qzint.cpp index 10a9ad09..6a50ca4e 100644 --- a/backend_qt4/qzint.cpp +++ b/backend_qt4/qzint.cpp @@ -334,8 +334,10 @@ namespace Zint { qreal gwidth = m_zintSymbol->width; qreal gheight = m_zintSymbol->height; if (m_zintSymbol->symbology == BARCODE_MAXICODE) { - gheight *= (maxi_width); - gwidth *= (maxi_width + 1); +// gheight *= (maxi_width); +// gwidth *= (maxi_width + 1); + gwidth *= 2.0; + gheight *= 2.0; } if (m_zintSymbol->output_options & BARCODE_DOTTY_MODE) { @@ -356,13 +358,13 @@ namespace Zint { textoffset = 0; } gwidth += m_zintSymbol->whitespace_width * 2; - switch (mode) { - case IgnoreAspectRatio: - xsf = (qreal) paintRect.width() / gwidth; - ysf = (qreal) paintRect.height() / gheight; - break; - - case KeepAspectRatio: +// switch (mode) { +// case IgnoreAspectRatio: +// xsf = (qreal) paintRect.width() / gwidth; +// ysf = (qreal) paintRect.height() / gheight; +// break; +// +// case KeepAspectRatio: if (paintRect.width() / gwidth < paintRect.height() / gheight) { ysf = xsf = (qreal) paintRect.width() / gwidth; ytr += (qreal) (paintRect.height() - gheight * ysf) / 2; @@ -370,13 +372,13 @@ namespace Zint { ysf = xsf = (qreal) paintRect.height() / gheight; xtr += (qreal) (paintRect.width() - gwidth * xsf) / 2; } - break; +// break; - case CenterBarCode: - xtr += ((qreal) paintRect.width() - gwidth * xsf) / 2; - ytr += ((qreal) paintRect.height() - gheight * ysf) / 2; - break; - } +// case CenterBarCode: +// xtr += ((qreal) paintRect.width() - gwidth * xsf) / 2; +// ytr += ((qreal) paintRect.height() - gheight * ysf) / 2; +// break; +// } painter.setBackground(QBrush(m_bgColor)); painter.fillRect(paintRect, QBrush(m_bgColor));