[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdeedu/kalzium/src
From:       Carsten Niehaus <cniehaus () gmx ! de>
Date:       2005-08-02 16:00:46
Message-ID: 1122998446.191729.24068.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 442412 by cniehaus:

Add minFontSize and maxFontSize (20 and 4 are default)

 M  +3 -3      kalziumutils.cpp  
 M  +3 -1      kalziumutils.h  


--- branches/KDE/3.5/kdeedu/kalzium/src/kalziumutils.cpp #442411:442412
@@ -7,10 +7,10 @@
 
 #include <math.h>
 
-int KalziumUtils::maxSize( const QString& string, const QRect& rect, QFont font, \
QPainter* p ) +int KalziumUtils::maxSize( const QString& string, const QRect& rect, \
QFont font, QPainter* p, int minFontSize, int maxFontSize )  {
 	bool goodSizeFound = false;
-	int size = 20;
+	int size = maxFontSize;
 	QRect r;
 
 	do
@@ -25,7 +25,7 @@
 		else
 			size--;
 	}
-	while ( !goodSizeFound && ( size > 4 ) );
+	while ( !goodSizeFound && ( size > minFontSize ) );
 
 	return size;
 }
--- branches/KDE/3.5/kdeedu/kalzium/src/kalziumutils.h #442411:442412
@@ -14,8 +14,10 @@
 		 * @param rect the rect needed for measurement
 		 * @param font the used font
 		 * @param painter the used painter
+		 * @param maxFontSize the maximum fontsize
+		 * @param minFontSize the maximum fontsize
 		 */
-		static int maxSize( const QString& string, const QRect& rect, QFont font, \
QPainter* painter ); +		static int maxSize( const QString& string, const QRect& rect, \
QFont font, QPainter* painter, int minFontSize = 4, int maxFontSize = 20 );  
 		/**
 		 * calculate the 4-digit value of the value @p w. For 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic