     float distance_from_mix_line = (local_pos.x - vPieceRect.x) * vPieceRect.w -
                                    (local_pos.y - vPieceRect.y) * vPieceRect.z;
     distance_from_mix_line /= vPieceRectHypotenuseLength;
-    draw_solid_border(distance_from_mix_line, local_pos);
+
+    switch (vBorderStyle) {
+        case BORDER_STYLE_DASHED:
+        case BORDER_STYLE_DOTTED:
+        case BORDER_STYLE_OUTSET:
+        case BORDER_STYLE_INSET:
+        case BORDER_STYLE_SOLID:
+        case BORDER_STYLE_NONE:
+          draw_solid_border(distance_from_mix_line, local_pos);
+          break;
+        case BORDER_STYLE_DOUBLE:
+          draw_double_border(distance_from_mix_line, local_pos);
+          break;
+        default:
+          discard;
+
+    }
+
     oFragColor *= vec4(1, 1, 1, alpha);
-
 #else
     switch (vBorderStyle) {
         case BORDER_STYLE_DASHED:

            draw_solid_border(vDistanceFromMixLine, local_pos);
            break;
        case BORDER_STYLE_DOUBLE:
            draw_double_border(local_pos);
            break;
        default:
            discard;

  }
}

// TODO: Investigate performance of this shader and see
//       if it's worthwhile splitting it / removing branches etc.
void main(void) {
