Skip to content

Commit

Permalink
Keyframe: Replace AddPoint overload w/default arg
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Dec 4, 2020
1 parent cae2e7e commit db7bf5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
17 changes: 6 additions & 11 deletions src/KeyFrame.cpp
Expand Up @@ -29,6 +29,11 @@
*/

#include "KeyFrame.h"
#include "Exceptions.h"

#include <cassert> // For assert()
#include <iostream> // For std::cout
#include <iomanip> // For std::setprecision
#include <algorithm>
#include <functional>
#include <utility>
Expand Down Expand Up @@ -146,17 +151,7 @@ void Keyframe::AddPoint(Point p) {
}
}

// Add a new point on the key-frame, with some defaults set (BEZIER)
void Keyframe::AddPoint(double x, double y)
{
// Create a point
Point new_point(x, y, BEZIER);

// Add the point
AddPoint(new_point);
}

// Add a new point on the key-frame, with a specific interpolation type
// Add a new point on the key-frame, interpolate is optional (default: BEZIER)
void Keyframe::AddPoint(double x, double y, InterpolationType interpolate)
{
// Create a point
Expand Down
12 changes: 2 additions & 10 deletions src/KeyFrame.h
Expand Up @@ -31,14 +31,9 @@
#ifndef OPENSHOT_KEYFRAME_H
#define OPENSHOT_KEYFRAME_H

#include <iostream>
#include <iomanip>
#include <cmath>
#include <assert.h>
#include <vector>
#include "Exceptions.h"
#include "Fraction.h"
#include "Coordinate.h"
#include "Point.h"
#include "Json.h"

Expand Down Expand Up @@ -76,11 +71,8 @@ namespace openshot {
/// Add a new point on the key-frame. Each point has a primary coordinate, a left handle, and a right handle.
void AddPoint(Point p);

/// Add a new point on the key-frame, with some defaults set (BEZIER)
void AddPoint(double x, double y);

/// Add a new point on the key-frame, with a specific interpolation type
void AddPoint(double x, double y, InterpolationType interpolate);
/// Add a new point on the key-frame, with optional interpolation type
void AddPoint(double x, double y, InterpolationType interpolate=BEZIER);

/// Does this keyframe contain a specific point
bool Contains(Point p) const;
Expand Down

0 comments on commit db7bf5f

Please sign in to comment.