Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: views/controls/single_split_view.cc

Issue 7846010: Fixed crash when a SinglesplitView gets embdedded inside SingleSplitView (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: incorporated all review comments by Sky and Tfarina Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: views/controls/single_split_view.cc
diff --git a/views/controls/single_split_view.cc b/views/controls/single_split_view.cc
index 5addbb9186014c56a3cce95d8918c8d24c02d58c..06965bc6309786b9cc2f906339a0b4e312c399d5 100644
--- a/views/controls/single_split_view.cc
+++ b/views/controls/single_split_view.cc
@@ -246,7 +246,9 @@ int SingleSplitView::NormalizeDividerOffset(int divider_offset,
const gfx::Rect& bounds) const {
int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height());
if (divider_offset < 0)
- return (primary_axis_size - kDividerSize) / 2;
+ // Prevents negative check fail in gfx::Size() for an embedded
sky 2011/09/09 15:32:23 For a comment, how about 'primary_axis_size may <
Gajen 2011/09/12 15:13:44 Agreed but it won't add more value b'coz 0)Adds on
+ // SingleSplitView on very first Layout.
+ return std::max(0, (primary_axis_size - kDividerSize) / 2);
return std::min(divider_offset,
std::max(primary_axis_size - kDividerSize, 0));
}

Powered by Google App Engine
This is Rietveld 408576698