Skip to content

Commit

Permalink
Fix IWord::colortoString(): Round instead of truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
th-we committed Aug 12, 2023
1 parent adacaac commit fcb3d86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/XmlAltoOutputDev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1382,9 +1382,9 @@ GString *IWord::convtoX(double xcol) const {

GString *IWord::colortoString() const {
GString *tmp = new GString("#");
GString *tmpr = convtoX(static_cast<int>(255 * colorR));
GString *tmpg = convtoX(static_cast<int>(255 * colorG));
GString *tmpb = convtoX(static_cast<int>(255 * colorB));
GString *tmpr = convtoX(static_cast<int>(round(255 * colorR)));
GString *tmpg = convtoX(static_cast<int>(round(255 * colorG)));
GString *tmpb = convtoX(static_cast<int>(round(255 * colorB)));
tmp->append(tmpr);
tmp->append(tmpg);
tmp->append(tmpb);
Expand Down

0 comments on commit fcb3d86

Please sign in to comment.