Added time manipulation functions to TimeRange and Timeline

This commit is contained in:
Daniel Wolf
2016-04-19 22:06:20 +02:00
parent 895b942df3
commit baf2423b27
3 changed files with 29 additions and 0 deletions

View File

@@ -32,6 +32,20 @@ void TimeRange::resize(time_type start, time_type end) {
resize(TimeRange(start, end));
}
void TimeRange::shift(time_type offset) {
start += offset;
end += offset;
}
void TimeRange::grow(time_type value) {
start -= value;
end += value;
}
void TimeRange::shrink(time_type value) {
grow(-value);
}
bool TimeRange::operator==(const TimeRange& rhs) const {
return start == rhs.start && end == rhs.end;
}