diff --git a/src/ui/theme.c b/src/ui/theme.c
index 4184b1f..7fac6f0 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -3427,10 +3427,19 @@ meta_draw_op_draw_with_env (const MetaDrawOp    *op,
 
         meta_color_spec_render (op->data.line.color_spec, widget, &color);
         gdk_cairo_set_source_color (cr, &color);
-
+        cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
+        
         if (op->data.line.width > 0)
-          cairo_set_line_width (cr, op->data.line.width);
-
+          {
+            cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
+            cairo_set_line_width (cr, op->data.line.width);
+          }
+        else
+          {
+            cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
+            cairo_set_line_width (cr, 1.0);
+          }
+        
         if (op->data.line.dash_on_length > 0 &&
             op->data.line.dash_off_length > 0)
           {
@@ -3461,33 +3470,10 @@ meta_draw_op_draw_with_env (const MetaDrawOp    *op,
               y2 = parse_y_position_unchecked (op->data.line.y2, env);
             else
               y2 = y1;
-
-            /* This is one of the cases where we are matching the exact
-             * pixel aligned rectangle produced by X.
-             */
-            if (y1 == y2 || x1 == x2)
-              {
-                double offset = (op->data.line.width == 0 ||
-                                 op->data.line.width % 2) ? .5 : 0;
-                /* X includes end points for lines of width 0 */
-                double line_extend = op->data.line.width == 0 ? 1. : 0.;
-
-                if (y1 == y2)
-                  {
-                    cairo_move_to (cr, x1, y1 + offset);
-                    cairo_line_to (cr, x2 + line_extend, y2 + offset);
-                  }
-                else
-                  {
-                    cairo_move_to (cr, x1 + offset, y1);
-                    cairo_line_to (cr, x2 + offset, y2 + line_extend);
-                  }
-              }
-            else
-              {
-                cairo_move_to (cr, x1 + .5, y1 + .5);
-                cairo_line_to (cr, x2 + .5, y2 + .5);
-              }
+          
+            cairo_move_to (cr, x1 + .5, y1 + .5);
+            cairo_line_to (cr, x2 + .5, y2 + .5);
+            
             cairo_stroke (cr);
           }
       }
@@ -3585,7 +3571,7 @@ meta_draw_op_draw_with_env (const MetaDrawOp    *op,
             meta_color_spec_render (op->data.tint.color_spec, widget, &color);
             gdk_cairo_set_source_color (cr, &color);
 
-            cairo_rectangle (cr, rx + .5, ry + .5, rwidth, rheight);
+            cairo_rectangle (cr, rx, ry, rwidth, rheight);
             cairo_fill (cr);
           }
         else
