Skip to content

Commit

Permalink
fix: use kwargs for tv_setactiveshape parameters (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenrybrunch authored Apr 22, 2024
1 parent 754e411 commit 0b63e2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pytvpaint/george/grg_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,14 +967,14 @@ def tv_get_active_shape() -> TVPShape:
return tv_cast_to_type(send_cmd("tv_GetActiveShape"), TVPShape)


def tv_set_active_shape(shape: TVPShape, *shape_args: Any) -> None:
def tv_set_active_shape(shape: TVPShape, **shape_kwargs: Any) -> None:
"""Set the current shape and its tool parameters.
Args:
shape: the shape to set
*shape_args: the shape specific parameters
**shape_kwargs: the shape specific parameters as keyword arguments
"""
send_cmd("tv_SetActiveShape", shape.value, *shape_args)
send_cmd("tv_SetActiveShape", shape.value, *args_dict_to_list(shape_kwargs))


@overload
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def count_up_generate(test_clip_obj: Clip) -> None:
send_cmd("tv_TextTool2", "size", 200) # set text size
george.tv_text_brush(str(i)) # set the brush text
george.tv_set_active_shape(
george.TVPShape.FREE_HAND_LINE, "size", 200
george.TVPShape.FREE_HAND_LINE, size=200
) # set the shape and it's size
# write a line with the text brush, having the start-end pos being the same will fake a single click
george.tv_line(text_pos, text_pos)
Expand Down

0 comments on commit 0b63e2f

Please sign in to comment.