Skip to content

Commit

Permalink
libappfw|GuiWidget: Take opacity into account when blurring
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 10, 2014
1 parent 620b91a commit 1163ae1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doomsday/libappfw/include/de/framework/guiwidget.h
Expand Up @@ -363,7 +363,7 @@ class LIBAPPFW_PUBLIC GuiWidget : public QObject, public Widget
*/
virtual void drawContent();

void drawBlurredRect(Rectanglei const &rect, Vector4f const &color);
void drawBlurredRect(Rectanglei const &rect, Vector4f const &color, float opacity = 1.0f);

/**
* Extensible mechanism for derived widgets to build their geometry. The
Expand Down
6 changes: 3 additions & 3 deletions doomsday/libappfw/src/guiwidget.cpp
Expand Up @@ -297,7 +297,7 @@ DENG2_PIMPL(GuiWidget)
// into the original target.
if(background.solidFill.w > 0)
{
self.drawBlurredRect(self.rule().recti(), background.solidFill);
self.drawBlurredRect(self.rule().recti(), background.solidFill, self.visibleOpacity());
}
}

Expand Down Expand Up @@ -739,7 +739,7 @@ void GuiWidget::glDeinit()
void GuiWidget::drawContent()
{}

void GuiWidget::drawBlurredRect(Rectanglei const &rect, Vector4f const &color)
void GuiWidget::drawBlurredRect(Rectanglei const &rect, Vector4f const &color, float opacity)
{
DENG2_ASSERT(d->blurInited);
if(!d->blurInited) return;
Expand All @@ -752,7 +752,7 @@ void GuiWidget::drawBlurredRect(Rectanglei const &rect, Vector4f const &color)
d->uBlurColor = Vector4f((1 - color.w) + color.x * color.w,
(1 - color.w) + color.y * color.w,
(1 - color.w) + color.z * color.w,
1.f);
opacity);
d->uBlurWindow = Vector4f(rect.left() / float(viewSize.x),
rect.top() / float(viewSize.y),
rect.width() / float(viewSize.x),
Expand Down

0 comments on commit 1163ae1

Please sign in to comment.