   // 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);
-
+  // This is the conversion factor for transformations and device pixel scaling.
+  float pixels_per_fragment = length(fwidth(vLocalPos.xy));
   vec4 white = vec4(1.0, 1.0, 1.0, 1.0);
-  return mix(white, color, should_fill);
+  return mix(white, get_fragment_color(vF, pixels_per_fragment), should_fill);
 }
 
 vec4 draw_double_edge_vertical() {

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

#ifdef WR_FEATURE_TRANSFORM

    case PST_TOP_LEFT:
    case PST_TOP_RIGHT:
    case PST_BOTTOM_LEFT:
    case PST_BOTTOM_RIGHT: {
      // This is the conversion factor for transformations and device pixel scaling.
      float pixelsPerFragment = length(fwidth(localPos.xy));
      oFragColor = get_fragment_color(vF, pixelsPerFragment);
      draw_antialiased_solid_border_corner(localPos, pixelsPerFragment);
      break;
    }
    default:
      oFragColor = vHorizontalColor;
      discard_pixels_in_rounded_borders(localPos);
