+ zoom_all on startup
This commit is contained in:
Artem Pavlenko 2010-01-20 15:25:41 +00:00
parent c8ca617832
commit a42f3d7265
2 changed files with 12 additions and 9 deletions

View file

@ -48,15 +48,15 @@ int main( int argc, char **argv )
if (boost::filesystem::exists(path) && boost::filesystem::is_directory(path)) 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 ); QApplication app( argc, argv );
MainWindow window; MainWindow window;

View file

@ -169,8 +169,11 @@ void MainWindow::load_map_file(QString const& filename)
unsigned height = mapWidget_->height(); unsigned height = mapWidget_->height();
boost::shared_ptr<mapnik::Map> map(new mapnik::Map(width,height)); boost::shared_ptr<mapnik::Map> map(new mapnik::Map(width,height));
mapnik::load_map(*map,filename.toStdString()); mapnik::load_map(*map,filename.toStdString());
mapWidget_->setMap(map); 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)); layerTab_->setModel(new LayerListModel(map,this));
styleTab_->setModel(new StyleModel(map,this)); styleTab_->setModel(new StyleModel(map,this));
} }