mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Removed ImageDraw methods deprecated in PIL 1.1.15
This commit is contained in:
parent
affa2d9a22
commit
94ed100bb2
|
@ -90,34 +90,6 @@ class ImageDraw(object):
|
||||||
self.fill = 0
|
self.fill = 0
|
||||||
self.font = None
|
self.font = None
|
||||||
|
|
||||||
##
|
|
||||||
# Set the default pen color.
|
|
||||||
|
|
||||||
def setink(self, ink):
|
|
||||||
# compatibility
|
|
||||||
if warnings:
|
|
||||||
warnings.warn(
|
|
||||||
"'setink' is deprecated; use keyword arguments instead",
|
|
||||||
DeprecationWarning, stacklevel=2
|
|
||||||
)
|
|
||||||
if isStringType(ink):
|
|
||||||
ink = ImageColor.getcolor(ink, self.mode)
|
|
||||||
if self.palette and not isinstance(ink, numbers.Number):
|
|
||||||
ink = self.palette.getcolor(ink)
|
|
||||||
self.ink = self.draw.draw_ink(ink, self.mode)
|
|
||||||
|
|
||||||
##
|
|
||||||
# Set the default background color.
|
|
||||||
|
|
||||||
def setfill(self, onoff):
|
|
||||||
# compatibility
|
|
||||||
if warnings:
|
|
||||||
warnings.warn(
|
|
||||||
"'setfill' is deprecated; use keyword arguments instead",
|
|
||||||
DeprecationWarning, stacklevel=2
|
|
||||||
)
|
|
||||||
self.fill = onoff
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Set the default font.
|
# Set the default font.
|
||||||
|
|
||||||
|
|
|
@ -44,14 +44,6 @@ class TestImageDraw(PillowTestCase):
|
||||||
draw.polygon(list(range(100)))
|
draw.polygon(list(range(100)))
|
||||||
draw.rectangle(list(range(4)))
|
draw.rectangle(list(range(4)))
|
||||||
|
|
||||||
def test_deprecated(self):
|
|
||||||
im = hopper().copy()
|
|
||||||
|
|
||||||
draw = ImageDraw.Draw(im)
|
|
||||||
|
|
||||||
self.assert_warning(DeprecationWarning, lambda: draw.setink(0))
|
|
||||||
self.assert_warning(DeprecationWarning, lambda: draw.setfill(0))
|
|
||||||
|
|
||||||
def test_mode_mismatch(self):
|
def test_mode_mismatch(self):
|
||||||
im = hopper("RGB").copy()
|
im = hopper("RGB").copy()
|
||||||
|
|
||||||
|
|
|
@ -278,21 +278,6 @@ these methods. Do not mix the old and new calling conventions.
|
||||||
|
|
||||||
:rtype: :py:class:`~PIL.ImageDraw.Draw`
|
:rtype: :py:class:`~PIL.ImageDraw.Draw`
|
||||||
|
|
||||||
.. py:method:: PIL.ImageDraw.Draw.setink(ink)
|
|
||||||
|
|
||||||
.. deprecated:: 1.1.5
|
|
||||||
|
|
||||||
Sets the color to use for subsequent draw and fill operations.
|
|
||||||
|
|
||||||
.. py:method:: PIL.ImageDraw.Draw.setfill(fill)
|
|
||||||
|
|
||||||
.. deprecated:: 1.1.5
|
|
||||||
|
|
||||||
Sets the fill mode.
|
|
||||||
|
|
||||||
If the mode is 0, subsequently drawn shapes (like polygons and rectangles)
|
|
||||||
are outlined. If the mode is 1, they are filled.
|
|
||||||
|
|
||||||
.. py:method:: PIL.ImageDraw.Draw.setfont(font)
|
.. py:method:: PIL.ImageDraw.Draw.setfont(font)
|
||||||
|
|
||||||
.. deprecated:: 1.1.5
|
.. deprecated:: 1.1.5
|
||||||
|
|
Loading…
Reference in New Issue
Block a user