summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-04-27 11:46:24 +0100
committerCarl Hetherington <cth@carlh.net>2018-04-27 11:46:24 +0100
commit565490c24a46d0aa941f75cf2a03b195246008b4 (patch)
tree4303c17898119e67b676ed0bb0c043e3a8f1d7f5 /src/lib
parentf65afabda0088de3e4ec2e3d2355ba70a29e711e (diff)
Fix crazy thinko in Rect::extend() causing subtitles to disappear when they were merged.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/rect.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/rect.h b/src/lib/rect.h
index d0daec437..4851ad007 100644
--- a/src/lib/rect.h
+++ b/src/lib/rect.h
@@ -91,10 +91,12 @@ public:
void extend (Rect<T> const & other)
{
+ T old_x = x;
+ T old_y = y;
x = std::min (x, other.x);
y = std::min (y, other.y);
- width = std::max (x + width, other.x + other.width) - x;
- height = std::max (y + height, other.y + other.height) - y;
+ width = std::max (old_x + width, other.x + other.width) - x;
+ height = std::max (old_y + height, other.y + other.height) - y;
}
Rect<T> extended (T amount) const {