Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
fix: 複数値を指定するプロパティの受け取り処理修正
Browse files Browse the repository at this point in the history
  • Loading branch information
PigeonsHouse committed Dec 27, 2023
1 parent 16304cb commit 66b4480
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/definition/vss.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
TIME_PATTERN = "({}|{}|{})".format(
SECOND_PATTERN, FRAME_PATTERN, PERCENT_PATTERN
)
GRAPHIC_PATTERN = "({}|{}|{}|{}|{}|{})".format(
GRAPHIC_PATTERN = "({}|{}|{}|{}|{}|{}|0)".format(
PIXEL_PATTERN,
RESOLUTION_WIDTH_PATTERN,
RESOLUTION_HEIGHT_PATTERN,
Expand Down Expand Up @@ -480,12 +480,12 @@
"align-content": "",
"justify-content": "",
"align-items": "",
"margin": r"{0}(\s+{0}){{0,3}}".format(GRAPHIC_PATTERN),
"margin": r"{0}(\s+{0}){1}".format(GRAPHIC_PATTERN, "{0,3}"),
"margin-top": GRAPHIC_PATTERN,
"margin-left": GRAPHIC_PATTERN,
"margin-bottom": GRAPHIC_PATTERN,
"margin-right": GRAPHIC_PATTERN,
"padding": r"{0}(\s+{0}){{0,3}}".format(GRAPHIC_PATTERN),
"padding": r"{0}(\s+{0}){1}".format(GRAPHIC_PATTERN, "{0,3}"),
"padding-top": GRAPHIC_PATTERN,
"padding-left": GRAPHIC_PATTERN,
"padding-bottom": GRAPHIC_PATTERN,
Expand Down
3 changes: 3 additions & 0 deletions src/style/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ def __init__(self, val: str) -> None:
elif val[-1:] == "%":
self.unit = GraphicUnit.PERCENT
self.value = int(val[:-1])
elif val == "0":
self.unit = GraphicUnit.PIXEL
self.value = 0
else:
raise ValueError()

Expand Down

0 comments on commit 66b4480

Please sign in to comment.