Skip to content

Commit 84b3b70

Browse files
committed
Fix some mistakes
1 parent fca9305 commit 84b3b70

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src_c/font.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,10 @@ font_getter_style_name(PyObject *self, void *closure)
832832
static int
833833
font_setter_outline(PyObject *self, PyObject *value, void *closure)
834834
{
835+
if (!PgFont_GenerationCheck(self)) {
836+
RAISE_FONT_QUIT_ERROR_RETURN(-1);
837+
}
838+
835839
TTF_Font *font = PyFont_AsFont(self);
836840
int val;
837841

@@ -846,6 +850,10 @@ font_setter_outline(PyObject *self, PyObject *value, void *closure)
846850
static PyObject *
847851
font_getter_outline(PyObject *self, void *closure)
848852
{
853+
if (!PgFont_GenerationCheck(self)) {
854+
return RAISE_FONT_QUIT_ERROR();
855+
}
856+
849857
return PyLong_FromLong(TTF_GetFontOutline(PyFont_AsFont(self)));
850858
}
851859

@@ -1079,7 +1087,7 @@ static PyGetSetDef font_getsets[] = {
10791087
{"point_size", (getter)font_getter_point_size,
10801088
(setter)font_setter_point_size, DOC_FONT_FONT_POINTSIZE, NULL},
10811089
{"outline", (getter)font_getter_outline, (setter)font_setter_outline,
1082-
"TODO", NULL},
1090+
DOC_FONT_FONT_OUTLINE, NULL},
10831091
{NULL, NULL, NULL, NULL, NULL}};
10841092

10851093
static PyMethodDef font_methods[] = {

test/font_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ def test_font_property_should_raise_exception_after_quit(self):
982982
("italic", True),
983983
("underline", True),
984984
("strikethrough", True),
985+
("outline", True),
985986
]
986987
skip_properties = set()
987988
version = pygame.font.get_sdl_ttf_version()

0 commit comments

Comments
 (0)