Changeset 7aaa0b0ec7 in tspsg for src/mainwindow.cpp


Ignore:
Timestamp:
Aug 30, 2010, 7:48:47 PM (14 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
672e522ba2
Parents:
43c29c04ba
git-author:
Oleksii Serdiuk <contacts@…> (08/30/10 19:48:47)
git-committer:
Oleksii Serdiuk <contacts@…> (06/29/12 19:45:57)
Message:

Improved quality of graph when printing (in a little hackish way).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mainwindow.cpp

    r43c29c04ba r7aaa0b0ec7  
    257257QString html = solutionText->document()->toHtml("UTF-8"),
    258258                img =  fi.completeBaseName() + "." + format;
    259                 html.replace(QRegExp("<img\\s+src=\"tspsg://graph.pic\""), QString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"%4\"").arg(img).arg(graph.width() + 2).arg(graph.height() + 2).arg(tr("Solution Graph")));
     259                html.replace(QRegExp("<img\\s+src=\"tspsg://graph.pic\""), QString("<img src=\"%1\" alt=\"%2\"").arg(img, tr("Solution Graph")));
    260260
    261261                // Saving solution text as HTML
     
    280280                } else {
    281281#endif // NOSVG && QT_VERSION >= 0x040500
    282 QImage i(graph.width() + 2, graph.height() + 2, QImage::Format_ARGB32);
     282QImage i(graph.width(), graph.height(), QImage::Format_ARGB32);
    283283                        i.fill(0x00FFFFFF);
    284284QPainter p;
     
    735735        if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
    736736                pic.begin(&graph);
    737                 pic.setRenderHint(QPainter::Antialiasing);
    738                 pic.setFont(settings->value("Output/Font", QFont(getDefaultFont(), 9)).value<QFont>());
     737                pic.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
     738QFont font = settings->value("Output/Font", QFont(getDefaultFont(), 9)).value<QFont>();
     739//              font.setBold(true);
     740                font.setPointSizeF(font.pointSizeF() * 2);
     741                pic.setFont(font);
    739742                pic.setBrush(QBrush(QColor(Qt::white)));
     743QPen pen = pic.pen();
     744                pen.setWidth(2);
     745                pic.setPen(pen);
    740746                pic.setBackgroundMode(Qt::OpaqueMode);
    741747        }
     
    878884QTextImageFormat img;
    879885                img.setName("tspsg://graph.pic");
     886                img.setWidth(i.width() / 2);
     887                img.setHeight(i.height() / 2);
    880888
    881889                cur.setPosition(imgpos);
     
    10411049void MainWindow::drawNode(QPainter &pic, int nstep, bool left, SStep *step)
    10421050{
    1043 const int r = 35;
     1051const int r = 70;
    10441052qreal x, y;
    10451053        if (step != NULL)
Note: See TracChangeset for help on using the changeset viewer.