Cleanup duplicate show_picture codestuffs.

This commit is contained in:
Inusaito Sayori
2015-02-04 23:47:37 -05:00
parent f0b18e52a3
commit e625fa3b33
3 changed files with 14 additions and 55 deletions

View File

@@ -63,8 +63,10 @@ void show_picture(const LLUUID& id, const std::string& name)
// Try to show and focus existing preview
if (LLPreview::show(id)) return;
// If there isn't one, make a new preview
LLPreview* preview = new LLPreviewTexture("preview texture", gSavedSettings.getRect("PreviewTextureRect"), name, id);
preview->setFocus(true);
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = gSavedSettings.getRect("PreviewTextureRect");
(new LLPreviewTexture("preview texture", rect.translate(left - rect.mLeft, rect.mTop - top), name, id))->setFocus(true);
}
//static