Chromium Code Reviews| Index: ui/base/touch/selection_bound.cc |
| diff --git a/ui/base/touch/selection_bound.cc b/ui/base/touch/selection_bound.cc |
| index bd5b3c9c6beef999d944e58c6892cd446db8dbff..6aa472c6043ae38c2fda712dcab6197449542fdf 100644 |
| --- a/ui/base/touch/selection_bound.cc |
| +++ b/ui/base/touch/selection_bound.cc |
| @@ -65,4 +65,20 @@ gfx::Rect RectBetweenSelectionBounds(const SelectionBound& b1, |
| return gfx::Rect(top_left, gfx::Size(diff.x(), diff.y())); |
| } |
| +gfx::RectF RectFBetweenSelectionBounds(const SelectionBound& b1, |
| + const SelectionBound& b2) { |
| + gfx::PointF top_left(b1.edge_top()); |
|
jdduke (slow)
2015/04/14 18:39:12
Note that we could implement RectBetweenSelectionB
|
| + top_left.SetToMin(b1.edge_bottom()); |
| + top_left.SetToMin(b2.edge_top()); |
| + top_left.SetToMin(b2.edge_bottom()); |
| + |
| + gfx::PointF bottom_right(b1.edge_top()); |
| + bottom_right.SetToMax(b1.edge_bottom()); |
| + bottom_right.SetToMax(b2.edge_top()); |
| + bottom_right.SetToMax(b2.edge_bottom()); |
| + |
| + gfx::Vector2dF diff = bottom_right - top_left; |
| + return gfx::RectF(top_left, gfx::SizeF(diff.x(), diff.y())); |
| +} |
| + |
| } // namespace ui |