     case PST_BOTTOM:
     case PST_TOP:
     {
-      oFragColor = draw_dashed_edge(vLocalPos.x - vPieceRect.x, vPieceRect.w);
+      oFragColor = draw_dashed_edge(vLocalPos.x - vPieceRect.x, vPieceRect.w, pixels_per_fragment);
       break;
     }
     case PST_LEFT:
     case PST_RIGHT:
     {
-      oFragColor = draw_dashed_edge(vLocalPos.y - vPieceRect.y, vPieceRect.z);
+      oFragColor = draw_dashed_edge(vLocalPos.y - vPieceRect.y, vPieceRect.z, pixels_per_fragment);
       break;
     }
   }


#endif

vec4 draw_dashed_edge(float position, float border_width) {
  // TODO: Investigate exactly what FF does.
  float size = border_width * 3;
  float segment = floor(position / size) + 2;
  return mix(vec4(0, 0, 0, 0), vHorizontalColor, mod(segment, 2));
}

void draw_dashed_border(vec2 local_pos, float distance_from_mix_line) {

  float farFromCenter = length(aDesiredPos - aPixel) - aRadius;
  float pixelInCircle = 1.00 - clamp(farFromCenter, 0.0, 1.0);
  return vec4(aColor, pixelInCircle);
}

vec4 draw_dotted_edge() {
