   float farFromCenter = length(aDesiredPos - aPixel) - aRadius;
   float pixelInCircle = 1.00 - clamp(farFromCenter, 0.0, 1.0);
   return vec4(aColor, pixelInCircle);
+}
+
+// Draw a rectangle at aRect fill it with aColor. Only works on non-rotated
+// rects.
+vec4 drawRect(vec2 aPixel, vec4 aRect, vec3 aColor) {
+   // GLSL origin is bottom left, positive Y is up
+   bool inRect = (aRect.x <= aPixel.x) && (aPixel.x <= aRect.x + aRect.z) &&
+            (aPixel.y >= aRect.y) && (aPixel.y <= aRect.y + aRect.w);
+   return vec4(aColor, float(inRect));
 }
 
 vec4 draw_dotted_edge() {

	}

  switch (vBorderStyle) {
    case BORDER_STYLE_DOTTED:
    {
      draw_dotted_border();

  }
}

void draw_dashed_border(void) {
  switch (vBorderPart) {
    // These are the layer tile part PrimitivePart as uploaded by the tiling.rs
    case PST_TOP_LEFT:
    case PST_TOP_RIGHT:
    case PST_BOTTOM_LEFT:
    case PST_BOTTOM_RIGHT:
      // TODO: Fix for corners with a border-radius
      oFragColor = draw_dashed_edge();
      break;
    case PST_BOTTOM:
    case PST_TOP:
    case PST_LEFT:
    case PST_RIGHT:
      oFragColor = draw_dashed_edge();
      break;
  }
}

void main(void) {
	if (vRadii.x > 0.0 &&
		(distance(vRefPoint, vLocalPos) > vRadii.x ||
