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

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: Examples order changed 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
« no previous file with comments | « AUTHORS ('k') | views/examples/double_split_view_example.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f6ea618859f14b26f0f71e3920f7badf991751b0 100644
--- a/views/controls/single_split_view.cc
+++ b/views/controls/single_split_view.cc
@@ -246,7 +246,8 @@ 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;
+ // primary_axis_size may < kDividerSize during initial layout.
+ return std::max(0, (primary_axis_size - kDividerSize) / 2);
return std::min(divider_offset,
std::max(primary_axis_size - kDividerSize, 0));
}
« no previous file with comments | « AUTHORS ('k') | views/examples/double_split_view_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698