diff options
| author | Nick Dedekind <nicholas.dedekind@gmail.com> | 2012-12-13 12:56:29 +0000 |
|---|---|---|
| committer | Nick Dedekind <nicholas.dedekind@gmail.com> | 2012-12-13 12:56:29 +0000 |
| commit | 729cac05fe59785c633ab5201dae469aa02dd6b1 (patch) | |
| tree | a6006ebb7eb928d523ad41c4d74980f481e13035 /dash/previews | |
| parent | 886ed5ff3e37582f248de0b4cff4c3725f72a780 (diff) | |
Fixed MP code comments.
(bzr r2938.2.2)
Diffstat (limited to 'dash/previews')
| -rw-r--r-- | dash/previews/PreviewContainer.cpp | 14 | ||||
| -rw-r--r-- | dash/previews/SocialPreview.cpp | 6 | ||||
| -rw-r--r-- | dash/previews/SocialPreviewContent.cpp | 8 |
3 files changed, 14 insertions, 14 deletions
diff --git a/dash/previews/PreviewContainer.cpp b/dash/previews/PreviewContainer.cpp index fb408a51d..10e1560de 100644 --- a/dash/previews/PreviewContainer.cpp +++ b/dash/previews/PreviewContainer.cpp @@ -524,16 +524,16 @@ void PreviewContainer::DrawContent(nux::GraphicsEngine& gfx_engine, bool force_d nux::Geometry const& base = GetGeometry(); gfx_engine.PushClippingRectangle(base); - bool redirect_to_texture = RedirectRenderingToTexture(); + bool redirect_to_texture = RedirectRenderingToTexture(); // This is necessary when doing redirected rendering. Clean the area below this view. if (redirect_to_texture) - { - // This is necessary when doing redirected rendering. - // Clean the area below this view before drawing anything. - gfx_engine.GetRenderStates().SetBlend(false); - gfx_engine.QRP_Color(GetX(), GetY(), GetWidth(), GetHeight(), nux::Color(0.0f, 0.0f, 0.0f, 0.0f)); - } + { + // This is necessary when doing redirected rendering. + // Clean the area below this view before drawing anything. + gfx_engine.GetRenderStates().SetBlend(false); + gfx_engine.QRP_Color(GetX(), GetY(), GetWidth(), GetHeight(), nux::Color(0.0f, 0.0f, 0.0f, 0.0f)); + } // rely on the compiz event loop to come back to us in a nice throttling if (AnimationInProgress()) diff --git a/dash/previews/SocialPreview.cpp b/dash/previews/SocialPreview.cpp index 5e3128a42..39fe44a71 100644 --- a/dash/previews/SocialPreview.cpp +++ b/dash/previews/SocialPreview.cpp @@ -281,12 +281,12 @@ void SocialPreview::PreLayoutManagement() nux::Geometry geo_content(geo.x, geo.y, style.GetAppImageAspectRatio() * geo.height, geo.height); if (geo.width - geo_content.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin() < style.GetDetailsPanelMinimumWidth()) - geo_content.width = MAX(0, geo.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin() - style.GetDetailsPanelMinimumWidth()); + geo_content.width = std::max(0, geo.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin() - style.GetDetailsPanelMinimumWidth()); if (content_) { content_->SetMinMaxSize(geo_content.width, geo_content.height); } if (image_) { image_->SetMinMaxSize(geo_content.width, geo_content.height); } - int details_width = MAX(0, geo.width - geo_content.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin()); - int top_social_info_max_width = MAX(0, details_width - style.GetAppIconAreaWidth() - style.GetSpaceBetweenIconAndDetails()); + int details_width = std::max(0, geo.width - geo_content.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin()); + int top_social_info_max_width = std::max(0, details_width - style.GetAppIconAreaWidth() - style.GetSpaceBetweenIconAndDetails()); if (title_) { title_->SetMaximumWidth(top_social_info_max_width); } if (subtitle_) { subtitle_->SetMaximumWidth(top_social_info_max_width); } diff --git a/dash/previews/SocialPreviewContent.cpp b/dash/previews/SocialPreviewContent.cpp index 9e756b273..a6737ed84 100644 --- a/dash/previews/SocialPreviewContent.cpp +++ b/dash/previews/SocialPreviewContent.cpp @@ -149,8 +149,8 @@ void SocialPreviewContent::UpdateBaloonTexture() nux::Geometry geo_cr(GetBubbleGeometry(geo)); - int max_width = MAX(0, geo_cr.width - 2*(geo_cr.width*0.1)); - int max_height = MAX(0, (geo_cr.height - TAIL_HEIGHT) - 2*((geo_cr.height - TAIL_HEIGHT)*0.1)); + int max_width = std::max(0, (int)(geo_cr.width - 2*(geo_cr.width*0.1))); + int max_height = std::max(0, (int)((geo_cr.height - TAIL_HEIGHT) - 2*((geo_cr.height - TAIL_HEIGHT)*0.1))); // this will update the texture with the actual size of the text. text_->SetMaximumHeight(max_height); @@ -169,8 +169,8 @@ void SocialPreviewContent::UpdateBaloonTexture() void SocialPreviewContent::RedrawBubble(nux::Geometry const& geom, cairo_t* cr, nux::ButtonVisualState faked_state) { - double width = MAX(0, cairo_image_surface_get_width(cairo_get_target(cr))); - double height = MAX(0, cairo_image_surface_get_height(cairo_get_target(cr)) - TAIL_HEIGHT); + double width = std::max(0, cairo_image_surface_get_width(cairo_get_target(cr))); + double height = std::max(0, cairo_image_surface_get_height(cairo_get_target(cr)) - TAIL_HEIGHT); double tailPosition = width - TAIL_POS_FROM_RIGHT - TAIL_HEIGHT; if (width > 0 && height > 0) |
