[Kstars-devel] KDE/kdeedu/kstars/kstars
Alexey Khudyakov
alexey.skladnoy at gmail.com
Fri Jul 31 21:57:27 CEST 2009
SVN commit 1005322 by khudyakov:
Change API for FOV:draw. Now it take zoom factor instead of
FOV dimenstion. It's clearly responsibility of FOV class to
compute size of FOV in pixels.
This changeset introduce regressions:
* FOV is not drawed in FOVdialog
* FOV not drawed on sky map
CCMAIL: kstars-devel at kde.org
M +6 -3 fov.cpp
M +1 -1 fov.h
M +1 -1 skymapdraw.cpp
M +2 -1 widgets/fovwidget.cpp
--- trunk/KDE/kdeedu/kstars/kstars/fov.cpp #1005321:1005322
@@ -98,7 +98,10 @@
m_color = "#FFFFFF";
}
-void FOV::draw( QPainter &p, float pixelSizeX, float pixelSizeY ) {
+void FOV::draw( QPainter &p, float zoomFactor ) {
+ float pixelSizeX = sizeX() * zoomFactor / 57.3 / 60.0;
+ float pixelSizeY = sizeY() * zoomFactor / 57.3 / 60.0;
+
p.setPen( QColor( color() ) );
p.setBrush( Qt::NoBrush );
@@ -239,7 +242,7 @@
float sizeX, sizeY;
Shape shape;
if( fields.count() == 4 ) {
- name = fields[1];
+ name = fields[0];
sizeX = fields[1].toFloat(&ok);
if( !ok ) {
return QList<FOV*>();
@@ -251,7 +254,7 @@
}
color = fields[3];
} else if( fields.count() == 5 ) {
- name = fields[1];
+ name = fields[0];
sizeX = fields[1].toFloat(&ok);
if( !ok ) {
return QList<FOV*>();
--- trunk/KDE/kdeedu/kstars/kstars/fov.h #1005321:1005322
@@ -64,7 +64,7 @@
*@param p reference to the target QPainter. The painter should already be started.
*@param size the size of the target symbol, in pixels.
*/
- void draw( QPainter &p, float pixelSizeX, float pixelSizeY=-1 );
+ void draw( QPainter &p, float zoomFactor);
/** @short Fill list with default FOVs*/
static QList<FOV*> defaults();
--- trunk/KDE/kdeedu/kstars/kstars/skymapdraw.cpp #1005321:1005322
@@ -143,7 +143,7 @@
drawBoxes( p );
//draw FOV symbol
- ks->data()->fovSymbol.draw( p, (float)(Options::fOVSizeX() * Options::zoomFactor()/57.3/60.0), (float)(Options::fOVSizeY() * Options::zoomFactor()/57.3/60.0));
+
drawTelescopeSymbols( p );
drawObservingList( p );
drawZoomBox( p );
--- trunk/KDE/kdeedu/kstars/kstars/widgets/fovwidget.cpp #1005321:1005322
@@ -41,7 +41,8 @@
if ( m_FOV ) {
if ( m_FOV->sizeX() > 0 || m_FOV->sizeY() > 0 ) {
float aspectratio = m_FOV->sizeY() / m_FOV->sizeX();
- m_FOV->draw( p, (float)( 0.3*contentsRect().width() ), (float)( 0.3*contentsRect().width() * aspectratio ) );
+ // FIXME: regression. FOV is not drawn
+// m_FOV->draw( p, (float)( 0.3*contentsRect().width() ), (float)( 0.3*contentsRect().width() * aspectratio ) );
QFont smallFont = p.font();
smallFont.setPointSize( p.font().pointSize() - 2 );
p.setFont( smallFont );
More information about the Kstars-devel
mailing list