mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-05 14:10:52 +03:00
commit
349e220b0a
|
@ -75,9 +75,9 @@ class ImageDraw(object):
|
||||||
self.draw = Image.core.draw(self.im, blend)
|
self.draw = Image.core.draw(self.im, blend)
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
if mode in ("I", "F"):
|
if mode in ("I", "F"):
|
||||||
self.ink = self.draw.draw_ink(1, mode)
|
self.ink = self.draw.draw_ink(1)
|
||||||
else:
|
else:
|
||||||
self.ink = self.draw.draw_ink(-1, mode)
|
self.ink = self.draw.draw_ink(-1)
|
||||||
if mode in ("1", "P", "I", "F"):
|
if mode in ("1", "P", "I", "F"):
|
||||||
# FIXME: fix Fill2 to properly support matte for I+F images
|
# FIXME: fix Fill2 to properly support matte for I+F images
|
||||||
self.fontmode = "1"
|
self.fontmode = "1"
|
||||||
|
@ -110,13 +110,13 @@ class ImageDraw(object):
|
||||||
ink = ImageColor.getcolor(ink, self.mode)
|
ink = ImageColor.getcolor(ink, self.mode)
|
||||||
if self.palette and not isinstance(ink, numbers.Number):
|
if self.palette and not isinstance(ink, numbers.Number):
|
||||||
ink = self.palette.getcolor(ink)
|
ink = self.palette.getcolor(ink)
|
||||||
ink = self.draw.draw_ink(ink, self.mode)
|
ink = self.draw.draw_ink(ink)
|
||||||
if fill is not None:
|
if fill is not None:
|
||||||
if isStringType(fill):
|
if isStringType(fill):
|
||||||
fill = ImageColor.getcolor(fill, self.mode)
|
fill = ImageColor.getcolor(fill, self.mode)
|
||||||
if self.palette and not isinstance(fill, numbers.Number):
|
if self.palette and not isinstance(fill, numbers.Number):
|
||||||
fill = self.palette.getcolor(fill)
|
fill = self.palette.getcolor(fill)
|
||||||
fill = self.draw.draw_ink(fill, self.mode)
|
fill = self.draw.draw_ink(fill)
|
||||||
return ink, fill
|
return ink, fill
|
||||||
|
|
||||||
def arc(self, xy, start, end, fill=None, width=0):
|
def arc(self, xy, start, end, fill=None, width=0):
|
||||||
|
|
|
@ -2642,8 +2642,7 @@ _draw_ink(ImagingDrawObject* self, PyObject* args)
|
||||||
{
|
{
|
||||||
INT32 ink = 0;
|
INT32 ink = 0;
|
||||||
PyObject* color;
|
PyObject* color;
|
||||||
char* mode = NULL; /* not used in this release */
|
if (!PyArg_ParseTuple(args, "O", &color))
|
||||||
if (!PyArg_ParseTuple(args, "O|s", &color, &mode))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!getink(color, self->image->image, (char*) &ink))
|
if (!getink(color, self->image->image, (char*) &ink))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user