1
0
Fork 0

Fix some coastline issues.

This commit is contained in:
James Turner 2015-11-26 23:44:27 +00:00
parent bfb539f090
commit 242e79f5e9
3 changed files with 6 additions and 3 deletions

View file

@ -113,7 +113,7 @@ void BaseDiagram::paintEvent(QPaintEvent* pe)
QTransform t(transform());
p.setTransform(t);
paintCoastlines(&p);
paintPolygonData(&p);
paintNavaids(&p);
@ -135,7 +135,7 @@ void BaseDiagram::paintAirplaneIcon(QPainter* painter, const SGGeod& geod, int h
painter->drawPixmap(airplaneIconRect, pix);
}
void BaseDiagram::paintCoastlines(QPainter* painter)
void BaseDiagram::paintPolygonData(QPainter* painter)
{
QTransform xf = painter->transform();
QTransform invT = xf.inverted();

View file

@ -129,7 +129,7 @@ private:
void paintNavaid(QPainter *painter,
const QTransform& t,
const FGPositionedRef &pos);
void paintCoastlines(QPainter *painter);
void paintPolygonData(QPainter *painter);
void paintGeodVec(QPainter *painter, const flightgear::SGGeodVec &vec);
void fillClosedGeodVec(QPainter *painter, const QColor &color, const flightgear::SGGeodVec &vec);
};

View file

@ -352,6 +352,9 @@ void loadNaturalEarthFile(const std::string& aFileName,
SGPath path(globals->get_fg_root());
path.append( "Geodata" );
path.append(aFileName);
if (!path.exists())
return; // silently fail for now
flightgear::PolyLineList lines;
flightgear::SHPParser::parsePolyLines(path, aType, lines, areClosed);
flightgear::PolyLineList::iterator it;