[Kstars-devel] KDE/kdeedu/kstars/kstars/skycomponents
Médéric Boquien
mboquien at free.fr
Tue Aug 19 16:33:16 CEST 2008
Hi,
I must have been tired yesterday, looking at the diff i realise i have
introduced an obvious bug. If the trail is not faded, then no QPen is set.
The instruction psky.setPen( QPen( tcolor, 1 ) ); should be reintroduced just
after QColor tcolor = QColor(
data->colorScheme()->colorNamed( "PlanetTrailColor" ) );. I don't have access
to the sources right now so i cannot provide a patch before this evening, if
needed. It is my fault, i should have tested better. Sorry.
Regards,
Médéric
Le Tuesday 19 August 2008 10:23:15 Jason Harris, vous avez écrit :
> SVN commit 849413 by harris:
>
> Committing patch from Mederic to implement fading solar system trails with
> transparency instead of interpolating the color to SkyColor. This will
> make faded trails look correct when passing by the Milky Way.
>
> Added his changes to SolarSystemListComponent, as well as
> SolarSystemSingleComponent, so comets and asteroids can enjoy the new
> trails too
>
> :)
>
> CCMAIL: kstars-devel at kde.org
>
>
>
> M +2 -9 solarsystemlistcomponent.cpp
> M +2 -9 solarsystemsinglecomponent.cpp
>
>
> ---
> trunk/KDE/kdeedu/kstars/kstars/skycomponents/solarsystemlistcomponent.cpp
> #849412:849413 @@ -117,9 +117,6 @@
> float Width = map->scale() * map->width();
> float Height = map->scale() * map->height();
>
> - QColor tcolor1 = QColor( data->colorScheme()->colorNamed(
> "PlanetTrailColor" ) ); - QColor tcolor2 = QColor(
> data->colorScheme()->colorNamed( "SkyColor" ) ); -
> foreach ( SkyObject *obj, m_TrailList ) {
> //DEBUG
> kDebug() << obj->name() << endl;
> @@ -139,17 +136,13 @@
> doDrawLine = true;
> }
>
> - psky.setPen( QPen( tcolor1, 1 ) );
> bool firstPoint( true );
> + QColor tcolor = QColor( data->colorScheme()->colorNamed(
> "PlanetTrailColor" ) ); foreach ( p, ksp->trail() ) {
> if ( firstPoint ) { firstPoint = false; continue; } //skip
> first point
>
> if ( Options::fadePlanetTrails() ) {
> - //Define interpolated color
> - QColor tcolor = QColor(
> - (i*tcolor1.red() +
> (n-i)*tcolor2.red())/n, -
> (i*tcolor1.green() + (n-i)*tcolor2.green())/n, -
> (i*tcolor1.blue() + (n-i)*tcolor2.blue())/n ); +
> tcolor.setAlphaF(static_cast<qreal>(i)/static_cast<qreal>(n)); ++i;
> psky.setPen( QPen( tcolor, 1 ) );
> }
> ---
> trunk/KDE/kdeedu/kstars/kstars/skycomponents/solarsystemsinglecomponent.cpp
> #849412:849413 @@ -183,9 +183,6 @@
> float Width = map->scale() * map->width();
> float Height = map->scale() * map->height();
>
> - QColor tcolor1 = QColor( data->colorScheme()->colorNamed(
> "PlanetTrailColor" ) ); - QColor tcolor2 = QColor(
> data->colorScheme()->colorNamed( "SkyColor" ) ); -
> SkyPoint p = ksp()->trail().first();
> QPointF o = map->toScreen( &p );
> QPointF oLast( o );
> @@ -200,17 +197,13 @@
> doDrawLine = true;
> }
>
> - psky.setPen( QPen( tcolor1, 1 ) );
> bool firstPoint( true );
> + QColor tcolor = QColor( data->colorScheme()->colorNamed(
> "PlanetTrailColor" ) ); foreach ( p, ksp()->trail() ) {
> if ( firstPoint ) { firstPoint = false; continue; } //skip first
> point
>
> if ( Options::fadePlanetTrails() ) {
> - //Define interpolated color
> - QColor tcolor = QColor(
> - (i*tcolor1.red() +
> (n-i)*tcolor2.red())/n, - (i*tcolor1.green()
> + (n-i)*tcolor2.green())/n, -
> (i*tcolor1.blue() + (n-i)*tcolor2.blue())/n ); +
> tcolor.setAlphaF(static_cast<qreal>(i)/static_cast<qreal>(n)); ++i;
> psky.setPen( QPen( tcolor, 1 ) );
> }
> _______________________________________________
> Kstars-devel mailing list
> Kstars-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kstars-devel
More information about the Kstars-devel
mailing list