Fix bugs of ErrorViewer

pull/11/head
Kirigaya Kazuto 2017-07-07 11:38:57 +08:00
parent 1ac2ea6c31
commit c769c0a3db
2 changed files with 15 additions and 5 deletions

View File

@ -215,7 +215,9 @@ Rect Font::sizeText(const std::string& Text) const throw (ErrorViewer)
if(TTF_SizeText(_get(),Text.c_str(),&w,&h)!=0)
{
/// Something might be wrong
throw ErrorViewer();
ErrorViewer e;
e.fetch();
throw e;
}
return Rect(0,0,w,h);
}
@ -226,7 +228,9 @@ Rect Font::sizeUTF8(const std::string& Text) const throw (ErrorViewer)
if(TTF_SizeUTF8(_get(),Text.c_str(),&w,&h)!=0)
{
/// Something might be wrong
throw ErrorViewer();
ErrorViewer e;
e.fetch();
throw e;
}
return Rect(0,0,w,h);
}
@ -237,7 +241,9 @@ Rect Font::sizeUnicode(const uint16_t* Text) const throw (ErrorViewer)
if(TTF_SizeUNICODE(_get(),Text,&w,&h)!=0)
{
/// Something might be wrong
throw ErrorViewer();
ErrorViewer e;
e.fetch();
throw e;
}
return Rect(0,0,w,h);
}

View File

@ -58,7 +58,9 @@ Renderer::Renderer(Window& wnd,std::initializer_list<RendererType> RendererFlags
{
if(createRenderer(wnd,RendererFlags)!=0)
{
throw ErrorViewer();
ErrorViewer e;
e.fetch();
throw e;
}
}
@ -66,7 +68,9 @@ Renderer::Renderer(Surface& surf) throw (ErrorViewer)
{
if(createSoftRenderer(surf)!=0)
{
throw ErrorViewer();
ErrorViewer e;
e.fetch();
throw e;
}
}