   }
 }
 
-void draw_antialiased_solid_border_corner(vec2 local_pos) {
+void draw_antialiased_solid_border_corner(vec2 local_pos, float pixelsPerFragment) {
   if (vRadii.x <= 0.0) {
     return;
   }
-
-  // This is the conversion factor for transformations and device pixel scaling.
-  float pixelsPerFragment = length(fwidth(local_pos.xy));
 
   float distanceFromRef = distance(vRefPoint, local_pos);
 

  // And 0.0 for the blank part.
  float should_fill = in_first_part + in_third_part;

  float color_weight = step(0.0, vF);
  vec4 color = mix(vHorizontalColor, vVerticalColor, color_weight);

  vec4 white = vec4(1.0, 1.0, 1.0, 1.0);
  return mix(white, color, should_fill);
}

vec4 draw_double_edge_vertical() {

  if (vRadii.x > 0.0 && (distanceFromRef > vRadii.x || distanceFromRef < vRadii.z)) {
      discard;
  }
}

vec4 get_fragment_color(float distanceFromMixLine, float pixelsPerFragment) {
  // Here we are mixing between the two border colors. vF is already a distance
  // measure from the line that separates the two colors, but we need to convert
  // it to pixel space to properly antialias and them push it between the limits
  // accepted by `mix`.
  float colorMix = min(max(distanceFromMixLine / pixelsPerFragment, -0.5), 0.5) + 0.5;
  return mix(vHorizontalColor, vVerticalColor, colorMix);
}

#ifdef WR_FEATURE_TRANSFORM
