[Marble-devel] turn the map

Konrad Enzensberger e.konrad at mpegcode.com
Thu Apr 5 15:27:23 UTC 2012


Hi,

because of  MarbleWidgetInputHandler calculates new heading based on current 
heading value,
this code avoids to have values greater than +- 360.
But you are correct if someone sets any heading value from outside,
(which can not happen by direction values from GPS devices)

br, konrad

----- Original Message ----- 
From: "Torsten Rahn" <tackat at t-online.de>
To: <marble-devel at kde.org>
Sent: Thursday, April 05, 2012 4:13 PM
Subject: Re: [Marble-devel] turn the map




On Donnerstag, 5. April 2012 16:00:58 Bernhard Beschow wrote:
> > additional, i made a smal modification to:
> > MarbleMap::setHeading() to avoid having heading values greater than 360°
> > if(heading > 359)//enz
> >     heading = heading-360;
> > if(heading < -359)//enz
> >     heading = heading+360;

Wouldn't it be more generic to use something like fmod() here?
Currently this code would only cover values up to +-719 deg.

BR,
Torsten

_______________________________________________
Marble-devel mailing list
Marble-devel at kde.org
https://mail.kde.org/mailman/listinfo/marble-devel 



More information about the Marble-devel mailing list