|
|
|
@ -275,8 +275,6 @@ namespace MWGui
|
|
|
|
|
{
|
|
|
|
|
case BookTextParser::Event_ImgTag:
|
|
|
|
|
{
|
|
|
|
|
pag.setIgnoreLeadingEmptyLines(false);
|
|
|
|
|
|
|
|
|
|
const BookTextParser::Attributes & attr = parser.getAttributes();
|
|
|
|
|
|
|
|
|
|
if (attr.find("src") == attr.end() || attr.find("width") == attr.end() || attr.find("height") == attr.end())
|
|
|
|
@ -286,8 +284,19 @@ namespace MWGui
|
|
|
|
|
int width = MyGUI::utility::parseInt(attr.at("width"));
|
|
|
|
|
int height = MyGUI::utility::parseInt(attr.at("height"));
|
|
|
|
|
|
|
|
|
|
bool exists;
|
|
|
|
|
std::string correctedSrc = MWBase::Environment::get().getWindowManager()->correctBookartPath(src, width, height, &exists);
|
|
|
|
|
|
|
|
|
|
if (!exists)
|
|
|
|
|
{
|
|
|
|
|
std::cerr << "Warning: Could not find \"" << src << "\" referenced by an <img> tag." << std::endl;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pag.setIgnoreLeadingEmptyLines(false);
|
|
|
|
|
|
|
|
|
|
ImageElement elem(paper, pag, mBlockStyle,
|
|
|
|
|
src, width, height);
|
|
|
|
|
correctedSrc, width, height);
|
|
|
|
|
elem.paginate();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -471,8 +480,7 @@ namespace MWGui
|
|
|
|
|
MyGUI::IntCoord(left, pag.getCurrentTop(), width, mImageHeight), MyGUI::Align::Left | MyGUI::Align::Top,
|
|
|
|
|
parent->getName() + MyGUI::utility::toString(parent->getChildCount()));
|
|
|
|
|
|
|
|
|
|
std::string image = MWBase::Environment::get().getWindowManager()->correctBookartPath(src, width, mImageHeight);
|
|
|
|
|
mImageBox->setImageTexture(image);
|
|
|
|
|
mImageBox->setImageTexture(src);
|
|
|
|
|
mImageBox->setProperty("NeedMouse", "false");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|