Fix typo and missing serialisation of offsets at time of analysis.
authorCarl Hetherington <cth@carlh.net>
Fri, 24 Apr 2020 15:46:01 +0000 (17:46 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 24 Apr 2020 15:46:01 +0000 (17:46 +0200)
src/lib/subtitle_analysis.cc
src/lib/subtitle_analysis.h

index 91fec90b06cc70231de683da718bd51a081ad4de..f8254f00d62fa791742d097812445801e727a7d6 100644 (file)
@@ -50,6 +50,9 @@ SubtitleAnalysis::SubtitleAnalysis (boost::filesystem::path path)
                _bounding_box->width = bounding_box->number_child<double>("Width");
                _bounding_box->height = bounding_box->number_child<double>("Height");
        }
+
+       _analysis_x_offset = f.number_child<double>("AnalysisXOffset");
+       _analysis_y_offset = f.number_child<double>("AnalysisYOffset");
 }
 
 
@@ -69,6 +72,9 @@ SubtitleAnalysis::write (boost::filesystem::path path) const
                bounding_box->add_child("Height")->add_child_text(raw_convert<string>(_bounding_box->height));
        }
 
+       root->add_child("AnalysisXOffset")->add_child_text(raw_convert<string>(_analysis_x_offset));
+       root->add_child("AnalysisYOffset")->add_child_text(raw_convert<string>(_analysis_y_offset));
+
        doc->write_to_file_formatted (path.string());
 }
 
index 47eb5241149ea747e4d59e8aa40325198cab72b2..6a7049a294031220a5194d167fee8f729c9aaba9 100644 (file)
@@ -53,7 +53,7 @@ public:
        }
 
        double analysis_y_offset () const {
-               return _analysis_x_offset;
+               return _analysis_y_offset;
        }
 
 private: