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:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user