From d89eb914e286a5e1c107846c023afc38bc566f15 Mon Sep 17 00:00:00 2001 From: Benjamin Kirkbride Date: Mon, 1 Jun 2020 20:54:21 -0400 Subject: [PATCH 1/3] rf(tiled_object.Text): better organize attributes --- pytiled_parser/tiled_object.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pytiled_parser/tiled_object.py b/pytiled_parser/tiled_object.py index 324791d..6d7bb88 100644 --- a/pytiled_parser/tiled_object.py +++ b/pytiled_parser/tiled_object.py @@ -123,17 +123,20 @@ class Text(TiledObject): """ text: str - font_family: str = "sans-serif" - font_size: int = 16 - wrap: bool = False color: Color = "#000000" + + font_family: str = "sans-serif" + font_size: float = 16 + bold: bool = False italic: bool = False - underline: bool = False - strike_out: bool = False kerning: bool = True + strike_out: bool = False + underline: bool = False + horizontal_align: str = "left" vertical_align: str = "top" + wrap: bool = False @attr.s(auto_attribs=True, kw_only=True) From 0011efdbc262f3c14e7a540538837cd1eb56bf54 Mon Sep 17 00:00:00 2001 From: Benjamin Kirkbride Date: Mon, 1 Jun 2020 21:01:23 -0400 Subject: [PATCH 2/3] fix(properties): Darren doesn't know how to use VSCode --- pytiled_parser/properties.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pytiled_parser/properties.py b/pytiled_parser/properties.py index 9e198af..53d89e6 100644 --- a/pytiled_parser/properties.py +++ b/pytiled_parser/properties.py @@ -4,7 +4,6 @@ from typing import Dict, List, NamedTuple, Optional, Union from .common_types import Color Property = Union[int, float, Path, str, bool, Color] -class RawProperties = List[Dict[str, Property]] From 106ccab685230f4e85a50354087ace80fc5a99f4 Mon Sep 17 00:00:00 2001 From: Benjamin Kirkbride Date: Mon, 1 Jun 2020 21:01:41 -0400 Subject: [PATCH 3/3] tests:fix: use correct name of cast function --- tests/test_tiled_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_tiled_object.py b/tests/test_tiled_object.py index 3fe1b0e..02d99b1 100644 --- a/tests/test_tiled_object.py +++ b/tests/test_tiled_object.py @@ -1100,6 +1100,6 @@ OBJECTS = ELLIPSES + RECTANGLES + POINTS + TILES + POLYGONS + POLYLINES + TEXTS @pytest.mark.parametrize("raw_object_json,expected", OBJECTS) def test_parse_layer(raw_object_json, expected): raw_object = json.loads(raw_object_json) - result = tiled_object._cast_tiled_object(raw_object) + result = tiled_object.cast(raw_object) assert result == expected