summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-07-03 17:56:24 +0100
committerCarl Hetherington <cth@carlh.net>2015-07-03 17:56:24 +0100
commit0fb6983c70d6fe201768040563752cb75889197a (patch)
treeca30e9257364c24df8a6ef186036c3a7223ff1ea /src
parentc1c686f7e4e0ca298e38a675a4d3fbb347f83f29 (diff)
Write very small VPosition values as 0.
Diffstat (limited to 'src')
-rw-r--r--src/subtitle_asset.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index c0ffb75a..4d411e5a 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -304,7 +304,11 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* root, int time_code_rate, strin
text->set_attribute ("HPosition", raw_convert<string> (i->h_position() * 100, 6));
}
text->set_attribute ("VAlign", valign_to_string (i->v_align()));
- text->set_attribute ("VPosition", raw_convert<string> (i->v_position() * 100, 6));
+ if (i->v_position() > ALIGN_EPSILON) {
+ text->set_attribute ("VPosition", raw_convert<string> (i->v_position() * 100, 6));
+ } else {
+ text->set_attribute ("VPosition", "0");
+ }
text->add_child_text (i->text());
}
}