mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
gh-94473: Flatten arguments in tkinter.Canvas.coords() (GH-98479)
It now accepts not only "x1, y1, x2, y2, ..." and "[x1, y1, x2, y2, ...]", but also "(x1, y1), (x2, y2), ..." and "[(x1, y1), (x2, y2), ...]".
This commit is contained in:
parent
6fba031476
commit
9bc80dac47
4 changed files with 21 additions and 1 deletions
|
@ -901,6 +901,12 @@ class CanvasTest(AbstractWidgetTest, unittest.TestCase):
|
|||
c.coords(i, [21, 31, 41, 51, 61, 11])
|
||||
self.assertEqual(c.coords(i), [21.0, 31.0, 41.0, 51.0, 61.0, 11.0])
|
||||
|
||||
c.coords(i, (22, 32), (42, 52), (62, 12))
|
||||
self.assertEqual(c.coords(i), [22.0, 32.0, 42.0, 52.0, 62.0, 12.0])
|
||||
|
||||
c.coords(i, [(23, 33), (43, 53), (63, 13)])
|
||||
self.assertEqual(c.coords(i), [23.0, 33.0, 43.0, 53.0, 63.0, 13.0])
|
||||
|
||||
c.coords(i, 20, 30, 60, 10)
|
||||
self.assertEqual(c.coords(i), [20.0, 30.0, 60.0, 10.0])
|
||||
self.assertEqual(c.bbox(i), (18, 8, 62, 32))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue