aboutsummaryrefslogtreecommitdiff
path: root/src/GtkGif.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GtkGif.cpp')
-rw-r--r--src/GtkGif.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/GtkGif.cpp b/src/GtkGif.cpp
index 92aae88..5800e29 100644
--- a/src/GtkGif.cpp
+++ b/src/GtkGif.cpp
@@ -31,13 +31,16 @@ namespace dchat
surface->mark_dirty();
}
- void GtkGif::draw(const Cairo::RefPtr<Cairo::Context> &cairo, int width, int height)
+ void GtkGif::draw(const Cairo::RefPtr<Cairo::Context> &cairo, int width, int height, bool circularMask)
{
update();
- int minSize = std::min(width/2, height/2);
- cairo->arc(width/2, height/2, minSize, 0.0, 2.0 * M_PI);
- cairo->clip();
+ if(circularMask)
+ {
+ int minSize = std::min(width/2, height/2);
+ cairo->arc(width/2, height/2, minSize, 0.0, 2.0 * M_PI);
+ cairo->clip();
+ }
double scaleX = (double)width / (double)surface->get_width();
double scaleY = (double)height / (double)surface->get_height();