]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/gtkutil/xorrectangle.cpp
Merge commit 'ff48e71434a414958e6e56628ccf04284d030784' into master-merge
[xonotic/netradiant.git] / libs / gtkutil / xorrectangle.cpp
index e7012328d104a9df2c68916465cfbed088f85496..17d48bf9d097d3e103c6dd12866dc88a3d20be6e 100644 (file)
@@ -23,6 +23,7 @@ void XORRectangle::lazy_init()
 
 void XORRectangle::draw() const
 {
+#ifndef WORKAROUND_MACOS_GTK2_DESTROY
     const int x = float_to_integer(m_rectangle.x);
     const int y = float_to_integer(m_rectangle.y);
     const int w = float_to_integer(m_rectangle.w);
@@ -33,6 +34,7 @@ void XORRectangle::draw() const
     cairo_set_source_rgb(cr, 1, 1, 1);
     cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
     cairo_stroke(cr);
+#endif
 }
 
 XORRectangle::XORRectangle(ui::GLArea widget) : m_widget(widget), cr(0)
@@ -42,7 +44,9 @@ XORRectangle::XORRectangle(ui::GLArea widget) : m_widget(widget), cr(0)
 XORRectangle::~XORRectangle()
 {
     if (initialised()) {
+#ifndef WORKAROUND_MACOS_GTK2_DESTROY
         cairo_destroy(cr);
+#endif
     }
 }