Flip map zoom, to fit with user expectations better. http://code.google.com/p/flightgear-bugs/issues/detail?id=485
This commit is contained in:
parent
ec16f43f86
commit
d2d3fc054e
1 changed files with 14 additions and 12 deletions
|
@ -374,7 +374,7 @@ int MapData::_fontDescender = 0;
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const int MAX_ZOOM = 16;
|
||||
const int MAX_ZOOM = 12;
|
||||
const int SHOW_DETAIL_ZOOM = 8;
|
||||
const int CURSOR_PAN_STEP = 32;
|
||||
|
||||
|
@ -403,11 +403,13 @@ MapWidget::~MapWidget()
|
|||
void MapWidget::setProperty(SGPropertyNode_ptr prop)
|
||||
{
|
||||
_root = prop;
|
||||
int zoom = _root->getBoolValue("zoom", -1);
|
||||
int zoom = _root->getIntValue("zoom", -1);
|
||||
if (zoom < 0) {
|
||||
_root->setIntValue("zoom", 6); // default zoom
|
||||
}
|
||||
|
||||
// expose MAX_ZOOM to the UI
|
||||
_root->setIntValue("max-zoom", MAX_ZOOM);
|
||||
_root->setBoolValue("centre-on-aircraft", true);
|
||||
_root->setBoolValue("draw-data", false);
|
||||
_root->setBoolValue("magnetic-headings", true);
|
||||
|
@ -515,15 +517,6 @@ int MapWidget::zoom() const
|
|||
}
|
||||
|
||||
void MapWidget::zoomIn()
|
||||
{
|
||||
if (zoom() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_root->setIntValue("zoom", zoom() - 1);
|
||||
}
|
||||
|
||||
void MapWidget::zoomOut()
|
||||
{
|
||||
if (zoom() >= MAX_ZOOM) {
|
||||
return;
|
||||
|
@ -532,6 +525,15 @@ void MapWidget::zoomOut()
|
|||
_root->setIntValue("zoom", zoom() + 1);
|
||||
}
|
||||
|
||||
void MapWidget::zoomOut()
|
||||
{
|
||||
if (zoom() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_root->setIntValue("zoom", zoom() - 1);
|
||||
}
|
||||
|
||||
void MapWidget::draw(int dx, int dy)
|
||||
{
|
||||
_aircraft = SGGeod::fromDeg(fgGetDouble("/position/longitude-deg"),
|
||||
|
@ -561,7 +563,7 @@ void MapWidget::draw(int dx, int dy)
|
|||
_upHeading = 0.0;
|
||||
}
|
||||
|
||||
_cachedZoom = zoom();
|
||||
_cachedZoom = MAX_ZOOM - zoom();
|
||||
SGGeod topLeft = unproject(SGVec2d(_width/2, _height/2));
|
||||
// compute draw range, including a fudge factor for ILSs and other 'long'
|
||||
// symbols
|
||||
|
|
Loading…
Add table
Reference in a new issue