r16833 by craig - Backport change from #10212 to remove old custom Mac code

scribus-commit scribus-commit at lists.scribus.net
Thu Sep 15 18:43:45 UTC 2011


Author: craig
Date: Thu Sep 15 18:43:45 2011
New Revision: 16833

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16833
Log:
Backport change from #10212 to remove old custom Mac code

Modified:
    branches/Version135/Scribus/scribus/hruler.cpp
    branches/Version135/Scribus/scribus/vruler.cpp

Modified: branches/Version135/Scribus/scribus/hruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16833&path=/branches/Version135/Scribus/scribus/hruler.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/hruler.cpp (original)
+++ branches/Version135/Scribus/scribus/hruler.cpp Thu Sep 15 18:43:45 2011
@@ -845,33 +845,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: branches/Version135/Scribus/scribus/vruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16833&path=/branches/Version135/Scribus/scribus/vruler.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/vruler.cpp (original)
+++ branches/Version135/Scribus/scribus/vruler.cpp Thu Sep 15 18:43:45 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 += 11;
 	}
 }




More information about the scribus-commit mailing list