diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index cf23ecd8f..9ccf5cfe1 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -102,12 +102,10 @@ namespace MWGui _sender->getSize().height-44 ); drawItems(); - MyGUI::IntSize size = mAvatarImage->getSize(); + MyGUI::IntSize size = mAvatar->getSize(); - std::cout << "dims " << size.width << " " << size.height << std::endl; MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); - - mAvatarImage->setImageCoord (MyGUI::IntCoord(0,0,size.width, size.height)); + mAvatarImage->setSize(MyGUI::IntSize(std::max(mAvatar->getSize().width, 512), std::max(mAvatar->getSize().height, 1024))); } void InventoryWindow::onFilterChanged(MyGUI::Widget* _sender) @@ -267,9 +265,11 @@ namespace MWGui else mWindowManager.setSelectedWeapon(*weaponSlot, 100); /// \todo track weapon durability - MyGUI::IntSize size = mAvatarImage->getSize(); - mAvatarImage->setImageCoord (MyGUI::IntCoord(0,0,size.width, size.height)); + MyGUI::IntSize size = mAvatar->getSize(); + MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); + + mAvatarImage->setSize(MyGUI::IntSize(512, 1024)); } void InventoryWindow::pickUpObject (MWWorld::Ptr object) diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 3d3f0a58d..fd25aab08 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -42,7 +42,7 @@ namespace MWRender { bool wasVisible = mNode->getParentSceneNode()->getAttachedObject(0)->getVisible (); mNode->getParentSceneNode()->setVisible(true, false); - //mViewport->setDimensions (0, 0, float(sizeX) / float(512), float(sizeY) / float(1024)); + mViewport->setDimensions (0, 0, std::min(1.f, float(sizeX) / float(512)), std::min(1.f, float(sizeY) / float(1024))); mRenderTarget->update(); diff --git a/files/mygui/openmw_inventory_window.layout b/files/mygui/openmw_inventory_window.layout index b9e14fffa..31bf58c34 100644 --- a/files/mygui/openmw_inventory_window.layout +++ b/files/mygui/openmw_inventory_window.layout @@ -15,9 +15,9 @@ - - - + + +