+ tidy
+ zoom_all on startup
This commit is contained in:
parent
c8ca617832
commit
a42f3d7265
2 changed files with 12 additions and 9 deletions
|
@ -48,16 +48,16 @@ int main( int argc, char **argv )
|
|||
|
||||
if (boost::filesystem::exists(path) && boost::filesystem::is_directory(path))
|
||||
{
|
||||
for (boost::filesystem::directory_iterator itr(path);itr!=end_itr;++itr )
|
||||
for (boost::filesystem::directory_iterator itr(path);itr!=end_itr;++itr )
|
||||
{
|
||||
if (!boost::filesystem::is_directory(*itr) && is_font_file(itr->path().leaf()))
|
||||
{
|
||||
if (!boost::filesystem::is_directory(*itr) && is_font_file(itr->path().leaf()))
|
||||
{
|
||||
std::cout << "register font " << itr->string() << "\n";
|
||||
freetype_engine::register_font(itr->string());
|
||||
}
|
||||
std::cout << "register font " << itr->string() << "\n";
|
||||
freetype_engine::register_font(itr->string());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
QApplication app( argc, argv );
|
||||
MainWindow window;
|
||||
window.show();
|
||||
|
|
|
@ -169,8 +169,11 @@ void MainWindow::load_map_file(QString const& filename)
|
|||
unsigned height = mapWidget_->height();
|
||||
boost::shared_ptr<mapnik::Map> map(new mapnik::Map(width,height));
|
||||
mapnik::load_map(*map,filename.toStdString());
|
||||
|
||||
mapWidget_->setMap(map);
|
||||
mapWidget_->zoomToBox(default_extent_);
|
||||
map->zoom_all();
|
||||
mapnik::box2d<double> const& ext = map->getCurrentExtent();
|
||||
mapWidget_->zoomToBox(ext);
|
||||
layerTab_->setModel(new LayerListModel(map,this));
|
||||
styleTab_->setModel(new StyleModel(map,this));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue