Merge remote-tracking branch 'ragora/fixmapresize'

deque
Marc Zinnschlag 10 years ago
commit 690273d5b3

@ -537,6 +537,9 @@ namespace MWGui
getWidget(mPlayerArrowLocal, "CompassLocal");
getWidget(mPlayerArrowGlobal, "CompassGlobal");
mLastScrollWindowCoordinates = mLocalMap->getCoord();
mLocalMap->eventChangeCoord += MyGUI::newDelegate(this, &MapWindow::onChangeScrollWindowCoord);
mGlobalMap->setVisible (false);
getWidget(mButton, "WorldButton");
@ -632,6 +635,20 @@ namespace MWGui
mEditNoteDialog.setText("");
}
void MapWindow::onChangeScrollWindowCoord(MyGUI::Widget* sender)
{
MyGUI::IntCoord currentCoordinates = sender->getCoord();
MyGUI::IntPoint currentViewPortCenter = MyGUI::IntPoint(currentCoordinates.width / 2, currentCoordinates.height / 2);
MyGUI::IntPoint lastViewPortCenter = MyGUI::IntPoint(mLastScrollWindowCoordinates.width / 2, mLastScrollWindowCoordinates.height / 2);
MyGUI::IntPoint viewPortCenterDiff = currentViewPortCenter - lastViewPortCenter;
mLocalMap->setViewOffset(mLocalMap->getViewOffset() + viewPortCenterDiff);
mGlobalMap->setViewOffset(mGlobalMap->getViewOffset() + viewPortCenterDiff);
mLastScrollWindowCoordinates = currentCoordinates;
}
void MapWindow::renderGlobalMap(Loading::Listener* loadingListener)
{
mGlobalMapRender = new MWRender::GlobalMap("");

@ -200,6 +200,7 @@ namespace MWGui
void onNoteEditDelete();
void onNoteEditDeleteConfirm();
void onNoteDoubleClicked(MyGUI::Widget* sender);
void onChangeScrollWindowCoord(MyGUI::Widget* sender);
void globalMapUpdatePlayer();
MyGUI::ScrollView* mGlobalMap;
@ -211,6 +212,8 @@ namespace MWGui
MyGUI::IntPoint mLastDragPos;
bool mGlobal;
MyGUI::IntCoord mLastScrollWindowCoordinates;
// Markers on global map
typedef std::pair<int, int> CellId;
std::vector<CellId> mMarkers;

Loading…
Cancel
Save