~ubuntu-branches/ubuntu/wily/scribus/wily-proposed

« back to all changes in this revision

Viewing changes to scribus/hruler.cpp

  • Committer: Package Import Robot
  • Author(s): Oleksandr Moskalenko
  • Date: 2012-02-09 21:50:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120209215056-2wrx1ara0jbm7fi5
Tags: 1.4.0.dfsg+r17287-1
* New upstream stable release upload into Debian (Closes: #654703).
* Applied the Ubuntu armel patch.
* Removed non-free color swatches from resources.
* debian/control:
  - Moved icc-profiles from Recommends to Suggests (Closes: #655885).
  - Updated Standards-Version to 3.9.2.
  - Updated extended description per lintian warning.
* debian/rules:
  - Update mailcap (Closes: #630751). A request for mime.types update has
    been sent to the mime-support maintainer.
  - Added build-arch and build-indep targets per lintian warning.
* debian/patches:
  - top_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't install the non-free "doc" dir.
  - profiles_cmakelists.patch - don't install non-free sRGB profile.
* debian/copyright: 
  - Converted to the DEP5 machine readable foramt.
  - Added licenses for free color swatches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
845
845
void Hruler::drawNumber(QString txt, int x, int y0, QPainter & p)
846
846
{
847
847
        const int y = y0 - 3 + topline;
848
 
#ifndef Q_WS_MAC
849
848
        p.drawText(x,y,txt);
850
 
#else
851
 
        static const int SCALE = 16;
852
 
        QFontMetrics fm = p.fontMetrics();
853
 
        QRect bbox = fm.boundingRect(txt);
854
 
        static QPixmap pix;
855
 
        if (pix.width() < bbox.width()*SCALE || pix.height() < bbox.height()*SCALE)
856
 
                pix = QPixmap(bbox.width()*SCALE, bbox.height()*SCALE);
857
 
        QFont fnt = p.font();
858
 
        QPainter p2;
859
 
        pix.fill();
860
 
        p2.begin( &pix );
861
 
        if (fnt.pointSize() > 0)
862
 
                fnt.setPointSize(SCALE*fnt.pointSize()-SCALE/2);
863
 
        else if (fnt.pixelSize() > 0)
864
 
                fnt.setPixelSize(SCALE*fnt.pixelSize()-SCALE/2);
865
 
        else
866
 
                fnt.setPixelSize(SCALE);
867
 
        p2.setFont(fnt);
868
 
        p2.setBrush(p.brush());
869
 
        p2.drawText(-bbox.x()*SCALE, -bbox.y()*SCALE, txt);
870
 
        p2.end();
871
 
        p.scale(1.0/SCALE,1.0/SCALE);
872
 
        p.drawPixmap(x*SCALE, (y+bbox.top())*SCALE, pix, 0, 0, bbox.width()*SCALE, bbox.height()*SCALE);
873
 
        p.scale(SCALE,SCALE);
874
 
#endif
875
849
}
876
850
 
877
851
double Hruler::ruleSpacing() {