svg-ultralight 0.30.1__py3-none-any.whl → 0.31.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of svg-ultralight might be problematic. Click here for more details.

@@ -38,7 +38,12 @@ from svg_ultralight.string_conversion import (
38
38
  format_numbers,
39
39
  format_numbers_in_string,
40
40
  )
41
- from svg_ultralight.transformations import transform_element
41
+ from svg_ultralight.transformations import (
42
+ mat_apply,
43
+ mat_dot,
44
+ mat_invert,
45
+ transform_element,
46
+ )
42
47
 
43
48
  __all__ = [
44
49
  "BoundCollection",
@@ -52,6 +57,9 @@ __all__ = [
52
57
  "format_number",
53
58
  "format_numbers",
54
59
  "format_numbers_in_string",
60
+ "mat_apply",
61
+ "mat_dot",
62
+ "mat_invert",
55
63
  "new_bbox_union",
56
64
  "new_bound_union",
57
65
  "new_element",
@@ -59,6 +59,20 @@ def mat_apply(mat1: _Matrix, mat2: tuple[float, float]) -> tuple[float, float]:
59
59
  return mat1[0] * mat2[0] + mat1[4], mat1[3] * mat2[1] + mat1[5]
60
60
 
61
61
 
62
+ def mat_invert(tmat: _Matrix) -> _Matrix:
63
+ """Invert a 2D transformation matrix in svg format."""
64
+ a, b, c, d, e, f = tmat
65
+ det = a * d - b * c
66
+ return (
67
+ d / det,
68
+ -b / det,
69
+ -c / det,
70
+ a / det,
71
+ (c * f - d * e) / det,
72
+ (b * e - a * f) / det,
73
+ )
74
+
75
+
62
76
  def get_transform_matrix(elem: EtreeElement) -> _Matrix:
63
77
  """Get the transformation matrix from an svg element.
64
78
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: svg-ultralight
3
- Version: 0.30.1
3
+ Version: 0.31.0
4
4
  Summary: a sensible way to create svg files with Python
5
5
  Author-email: Shay Hill <shay_public@hotmail.com>
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- svg_ultralight/__init__.py,sha256=5lSOJM2dshB_cG3uNZbCp0q114mJ6wgJ59Kg4TYiiBU,2070
1
+ svg_ultralight/__init__.py,sha256=iuI06A3lFqv0L7EoUfaKqYDg-z0HUlxPATBavtOmexs,2181
2
2
  svg_ultralight/animate.py,sha256=fE-zRU_uFrZIL9W78fcGz7qmrts8fz5UoWEy7b4xb44,1144
3
3
  svg_ultralight/inkscape.py,sha256=M8yTxXOu4NlXnhsMycvEJiIDpnDeiZ_bZakJBM38ZoU,9152
4
4
  svg_ultralight/layout.py,sha256=TTETT_8WLBXnQxDGXdAeczCFN5pFo5kKY3Q6zv4FPX4,12238
@@ -9,7 +9,7 @@ svg_ultralight/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  svg_ultralight/query.py,sha256=_KQuk4IwhVVDgTT0GZm_gbqNUGp7lMEDM32b_CTTSUA,7320
10
10
  svg_ultralight/root_elements.py,sha256=pt9J6mPrnoTAZVF6vKTZoM_o947I8UCj6MbGcD2JUCk,2869
11
11
  svg_ultralight/string_conversion.py,sha256=WEmpf75RJmJ2lfJluagAz2wPsz6wM8XvTEwkq4U0vEc,7353
12
- svg_ultralight/transformations.py,sha256=CT43zaWSmEoWf-rQpFgP_1KX9wL6AzpR0cF8E1fIhAU,3625
12
+ svg_ultralight/transformations.py,sha256=64BN_UupvOZk4nbiKLKv09P3j0TPFhH6mKro_3QBqeY,3945
13
13
  svg_ultralight/unit_conversion.py,sha256=g07nhzXdjPvGcJmkhLdFbeDLrSmbI8uFoVgPo7G62Bg,9258
14
14
  svg_ultralight/bounding_boxes/__init__.py,sha256=qUEn3r4s-1QNHaguhWhhaNfdP4tl_B6YEqxtiTFuzhQ,78
15
15
  svg_ultralight/bounding_boxes/bound_helpers.py,sha256=YMClhdekeYbzD_ijXDAer-H3moWKN3lUNnZs1UNFFKc,3458
@@ -22,7 +22,7 @@ svg_ultralight/constructors/__init__.py,sha256=YcnO0iBQc19aL8Iemw0Y452MBMBIT2AN5
22
22
  svg_ultralight/constructors/new_element.py,sha256=VtMz9sPn9rMk6rui5Poysy3vezlOaS-tGIcGbu-SXmY,3406
23
23
  svg_ultralight/strings/__init__.py,sha256=Zalrf-ThFz7b7xKELx5lb2gOlBgV-6jk_k_EeSdVCVk,295
24
24
  svg_ultralight/strings/svg_strings.py,sha256=RYKMxOHq9abbZyGcFqsElBGLrBX-EjjNxln3s_ibi30,1296
25
- svg_ultralight-0.30.1.dist-info/METADATA,sha256=j2bSJ8HE0Y3JZv7S5ur92kpmbMd7FVeDe56aB9o3VTU,8871
26
- svg_ultralight-0.30.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
27
- svg_ultralight-0.30.1.dist-info/top_level.txt,sha256=se-6yqM_0Yg5orJKvKWdjQZ4iR4G_EjhL7oRgju-fdY,15
28
- svg_ultralight-0.30.1.dist-info/RECORD,,
25
+ svg_ultralight-0.31.0.dist-info/METADATA,sha256=6YvGWvgRIhX1HBnCfDHetPdcHyFJPxs-jojK7Ch9h4M,8871
26
+ svg_ultralight-0.31.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
27
+ svg_ultralight-0.31.0.dist-info/top_level.txt,sha256=se-6yqM_0Yg5orJKvKWdjQZ4iR4G_EjhL7oRgju-fdY,15
28
+ svg_ultralight-0.31.0.dist-info/RECORD,,