'@param size patch size'

def drawPatch(self, pos, turn, invert, type, draw, size, foreColor, backColor):

    path = self.PATH_SET[type]
    if (not path):
        invert = (not invert)
        path = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0), (0.0, 0.0)]
    patch = ImagePath.Path(path)
    if invert:
        (foreColor, backColor) = (backColor, foreColor)
    mat = ((Matrix2D.rotateSquare(turn, pivot=(0.5, 0.5)) * Matrix2D.translate(*pos)) * Matrix2D.scale(size, size))
    patch.transform(mat.for_PIL())
    draw.rectangle(((pos[0] * size), (pos[1] * size), ((pos[0] + 1) * size), ((pos[1] + 1) * size)), fill=backColor)
    draw.polygon(patch, fill=foreColor, outline=foreColor)
