mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
fix space optimization
This commit is contained in:
parent
8ef466714e
commit
821a65ac73
@ -313,7 +313,7 @@ void HTMLRenderer::TextLineBuffer::optimize(void)
|
|||||||
// set new word_space
|
// set new word_space
|
||||||
for(auto iter = states.begin(); iter != states.end(); ++iter)
|
for(auto iter = states.begin(); iter != states.end(); ++iter)
|
||||||
{
|
{
|
||||||
double new_word_space = avg_width - iter->single_space_offset();
|
double new_word_space = avg_width - iter->single_space_offset() + iter->word_space;
|
||||||
|
|
||||||
// install new word_space
|
// install new word_space
|
||||||
// we might introduce more variance here
|
// we might introduce more variance here
|
||||||
@ -420,7 +420,7 @@ int HTMLRenderer::TextLineBuffer::State::diff(const State & s) const
|
|||||||
|
|
||||||
double HTMLRenderer::TextLineBuffer::State::single_space_offset(void) const
|
double HTMLRenderer::TextLineBuffer::State::single_space_offset(void) const
|
||||||
{
|
{
|
||||||
return letter_space + font_info->space_width * draw_font_size;
|
return word_space + letter_space + font_info->space_width * draw_font_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the order should be the same as in the enum
|
// the order should be the same as in the enum
|
||||||
|
Loading…
Reference in New Issue
Block a user