From a3c20c8f447ab01619f8b452b36b5e88955da092 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Tue, 27 Oct 2020 02:50:02 -0500 Subject: [PATCH] Fixed a few codacy issues --- src/effects/Caption.cpp | 6 +++--- src/effects/Caption.h | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/effects/Caption.cpp b/src/effects/Caption.cpp index 43b24dd41..b9ce22492 100644 --- a/src/effects/Caption.cpp +++ b/src/effects/Caption.cpp @@ -44,8 +44,8 @@ Caption::Caption() : color("#ffffff"), stroke("#a9a9a9"), background("#ff000000" } // Default constructor -Caption::Caption(Color color, std::string captions) : - color(color), caption_text(captions), stroke("#a9a9a9"), background("#ff000000"), background_alpha(0.0), +Caption::Caption(std::string captions) : + color("#ffffff"), caption_text(captions), stroke("#a9a9a9"), background("#ff000000"), background_alpha(0.0), left(0.25), top(0.7), right(0.1), stroke_width(0.5), font_size(30.0), font_alpha(1.0), is_dirty(true), font_name("sans"), font(NULL), metrics(NULL), fade_in(0.35), fade_out(0.35), background_corner(10.0), background_padding(20.0) { @@ -220,7 +220,7 @@ std::shared_ptr Caption::GetFrame(std::shared_ptr= start_frame && frame_number <= end_frame && - !line.length() <= 1 ) { + line.length() > 1) { // Calculate fade in/out ranges double fade_in_percentage = ((float) frame_number - (float) start_frame) / fade_in_value; diff --git a/src/effects/Caption.h b/src/effects/Caption.h index 893474150..749b2c17f 100644 --- a/src/effects/Caption.h +++ b/src/effects/Caption.h @@ -90,9 +90,8 @@ namespace openshot /// Default constructor, which takes a string of VTT/Subrip formatted caption data, and displays them over time. /// - /// @param color The curve to adjust the color of caption text /// @param captions A string with VTT/Subrip format text captions - Caption(Color color, std::string captions); + Caption(std::string captions); /// @brief This method is required for all derived classes of ClipBase, and returns a /// new openshot::Frame object. All Clip keyframes and effects are resolved into