r16830 by craig - Make this old OSX only code disappear in favour of the generic drawText code for 10212
scribus-commit
scribus-commit at lists.scribus.net
Wed Sep 14 20:17:43 UTC 2011
Author: craig
Date: Wed Sep 14 20:17:43 2011
New Revision: 16830
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16830
Log:
Make this old OSX only code disappear in favour of the generic drawText code for 10212
Modified:
trunk/Scribus/scribus/ui/hruler.cpp
trunk/Scribus/scribus/ui/vruler.cpp
Modified: trunk/Scribus/scribus/ui/hruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16830&path=/trunk/Scribus/scribus/ui/hruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.cpp (original)
+++ trunk/Scribus/scribus/ui/hruler.cpp Wed Sep 14 20:17:43 2011
@@ -860,33 +860,7 @@
void Hruler::drawNumber(QString txt, int x, int y0, QPainter & p)
{
const int y = y0 - 3 + topline;
-#ifndef Q_WS_MAC
p.drawText(x,y,txt);
-#else
- static const int SCALE = 16;
- QFontMetrics fm = p.fontMetrics();
- QRect bbox = fm.boundingRect(txt);
- static QPixmap pix;
- if (pix.width() < bbox.width()*SCALE || pix.height() < bbox.height()*SCALE)
- pix = QPixmap(bbox.width()*SCALE, bbox.height()*SCALE);
- QFont fnt = p.font();
- QPainter p2;
- pix.fill();
- p2.begin( &pix );
- if (fnt.pointSize() > 0)
- fnt.setPointSize(SCALE*fnt.pointSize()-SCALE/2);
- else if (fnt.pixelSize() > 0)
- fnt.setPixelSize(SCALE*fnt.pixelSize()-SCALE/2);
- else
- fnt.setPixelSize(SCALE);
- p2.setFont(fnt);
- p2.setBrush(p.brush());
- p2.drawText(-bbox.x()*SCALE, -bbox.y()*SCALE, txt);
- p2.end();
- p.scale(1.0/SCALE,1.0/SCALE);
- p.drawPixmap(x*SCALE, (y+bbox.top())*SCALE, pix, 0, 0, bbox.width()*SCALE, bbox.height()*SCALE);
- p.scale(SCALE,SCALE);
-#endif
}
double Hruler::ruleSpacing() {
Modified: trunk/Scribus/scribus/ui/vruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16830&path=/trunk/Scribus/scribus/ui/vruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.cpp (original)
+++ trunk/Scribus/scribus/ui/vruler.cpp Wed Sep 14 20:17:43 2011
@@ -227,32 +227,7 @@
for (int a = 0; a < num.length(); ++a)
{
QString txt = num.mid(a, 1);
-#ifndef Q_WS_MAC
p->drawText(1, textY, txt);
-#else
- static const int SCALE = 16;
- QFontMetrics fm = p->fontMetrics();
- QRect bbox = fm.boundingRect(txt);
- static QPixmap pix;
- if (pix.width() < bbox.width()*SCALE || pix.height() < bbox.height()*SCALE)
- pix = QPixmap(bbox.width()*SCALE, bbox.height()*SCALE);
- QFont fnt = p->font();
- QPainter p2;
- pix.fill();
- p2.begin( &pix );
- if (fnt.pointSize() > 0)
- fnt.setPointSize(SCALE*fnt.pointSize()-SCALE/2);
- else if (fnt.pixelSize() > 0)
- fnt.setPixelSize(SCALE*fnt.pixelSize()-SCALE/2);
- else
- fnt.setPixelSize(SCALE);
- p2.setFont(fnt);
- p2.drawText(-bbox.x()*SCALE, -bbox.y()*SCALE, txt);
- p2.end();
- p->scale(1.0/SCALE,1.0/SCALE);
- p->drawPixmap(1*SCALE, (textY+bbox.top())*SCALE, pix, 0, 0, bbox.width()*SCALE, bbox.height()*SCALE);
- p->scale(SCALE,SCALE);
-#endif
textY += 8;
}
}
More information about the scribus-commit
mailing list