summaryrefslogtreecommitdiff
path: root/dash
diff options
authorNick Dedekind <nicholas.dedekind@gmail.com>2012-08-03 14:57:56 +0100
committerNick Dedekind <nicholas.dedekind@gmail.com>2012-08-03 14:57:56 +0100
commitaf4f28b97c71dd56341707d19a911adbb7f1bb0c (patch)
tree48cf342267d96e0a50a83bb4ce21f7082cbfbc7f /dash
parentb1760bcc697345f0148a094574e6479def28e4ba (diff)
Fixed crashes due to invalid geomotrys in action buttons.
(bzr r2419.4.32)
Diffstat (limited to 'dash')
-rw-r--r--dash/previews/ActionButton.cpp2
-rw-r--r--dash/previews/ApplicationPreview.cpp2
-rw-r--r--dash/previews/GenericPreview.cpp2
-rw-r--r--dash/previews/MoviePreview.cpp2
-rw-r--r--dash/previews/MusicPreview.cpp2
5 files changed, 5 insertions, 5 deletions
diff --git a/dash/previews/ActionButton.cpp b/dash/previews/ActionButton.cpp
index 92c6b833c..c7669ce78 100644
--- a/dash/previews/ActionButton.cpp
+++ b/dash/previews/ActionButton.cpp
@@ -164,7 +164,7 @@ long ActionButton::ComputeContentSize()
nux::Geometry const& geo = GetGeometry();
- if (cached_geometry_ != geo)
+ if (cached_geometry_ != geo && geo.width > 0 && geo.height > 0)
{
if (cr_prelight_) cr_prelight_->Invalidate(geo);
if (cr_active_) cr_active_->Invalidate(geo);
diff --git a/dash/previews/ApplicationPreview.cpp b/dash/previews/ApplicationPreview.cpp
index 1d1f0bd5b..4215d24b8 100644
--- a/dash/previews/ApplicationPreview.cpp
+++ b/dash/previews/ApplicationPreview.cpp
@@ -307,7 +307,7 @@ long ApplicationPreview::ComputeContentSize()
for (nux::AbstractButton* button : action_buttons_)
{
- button->SetMinMaxSize(MIN((details_width - style.GetSpaceBetweenActions()) / 2, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight());
+ button->SetMinMaxSize(CLAMP((details_width - style.GetSpaceBetweenActions()) / 2, 0, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight());
}
image_->ComputeContentSize();
diff --git a/dash/previews/GenericPreview.cpp b/dash/previews/GenericPreview.cpp
index 4c0bab5ef..8562b062f 100644
--- a/dash/previews/GenericPreview.cpp
+++ b/dash/previews/GenericPreview.cpp
@@ -242,7 +242,7 @@ long GenericPreview::ComputeContentSize()
for (nux::AbstractButton* button : action_buttons_)
{
- button->SetMinMaxSize(MIN((details_width - style.GetSpaceBetweenActions()) / 2, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight());
+ button->SetMinMaxSize(CLAMP((details_width - style.GetSpaceBetweenActions()) / 2, 0, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight());
}
image_->ComputeContentSize();
diff --git a/dash/previews/MoviePreview.cpp b/dash/previews/MoviePreview.cpp
index 68fccfac8..9d1da0933 100644
--- a/dash/previews/MoviePreview.cpp
+++ b/dash/previews/MoviePreview.cpp
@@ -254,7 +254,7 @@ long MoviePreview::ComputeContentSize()
for (nux::AbstractButton* button : action_buttons_)
{
- button->SetMinMaxSize(MIN((details_width - style.GetSpaceBetweenActions()) / 2, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight());
+ button->SetMinMaxSize(CLAMP((details_width - style.GetSpaceBetweenActions()) / 2, 0, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight());
}
image_->ComputeContentSize();
diff --git a/dash/previews/MusicPreview.cpp b/dash/previews/MusicPreview.cpp
index e414bd584..dfec27e29 100644
--- a/dash/previews/MusicPreview.cpp
+++ b/dash/previews/MusicPreview.cpp
@@ -270,7 +270,7 @@ long MusicPreview::ComputeContentSize()
for (nux::AbstractButton* button : action_buttons_)
{
- button->SetMinMaxSize(MIN((details_width - style.GetSpaceBetweenActions()) / 2, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight());
+ button->SetMinMaxSize(CLAMP((details_width - style.GetSpaceBetweenActions()) / 2, 0, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight());
}
image_->ComputeContentSize();