Fix text wrap in transcript to work with pixel width of text instead of character width

Also, remove all (or at least most) of the extraneous spaces from the end of transcript messages.
This commit is contained in:
2015-01-27 14:05:42 -05:00
parent 33b5116a77
commit 6ed3b11399
12 changed files with 280 additions and 273 deletions

View File

@@ -387,8 +387,8 @@ void win_draw_string(sf::RenderTarget& dest_window,rectangle dest_rect,std::stri
}
}
short string_length(std::string str, TextStyle style, short* height){
short total_width = 0;
size_t string_length(std::string str, TextStyle style, short* height){
size_t total_width = 0;
sf::Text text;
style.applyTo(text);

View File

@@ -112,7 +112,7 @@ void rect_draw_some_item(const sf::Texture& src_gworld,rectangle src_rect,const
std::vector<rectangle> draw_string_hilite(sf::RenderTarget& dest_window,rectangle dest_rect,std::string str,TextStyle style,std::vector<hilite_t> hilites,sf::Color hiliteClr);
std::vector<snippet_t> draw_string_sel(sf::RenderTarget& dest_window,rectangle dest_rect,std::string str,TextStyle style,std::vector<hilite_t> hilites,sf::Color hiliteClr);
void win_draw_string(sf::RenderTarget& dest_window,rectangle dest_rect,std::string str,eTextMode mode,TextStyle style, location offset = {0,0});
short string_length(std::string str, TextStyle style, short* height = nullptr);
size_t string_length(std::string str, TextStyle style, short* height = nullptr);
rectangle calc_rect(short i, short j);
void setActiveRenderTarget(sf::RenderTarget& where);
void flushTessels(sf::Texture& alteredImg);