diff --git a/docs/reST/ref/surface.rst b/docs/reST/ref/surface.rst index 30144fa00f..859acf075e 100644 --- a/docs/reST/ref/surface.rst +++ b/docs/reST/ref/surface.rst @@ -326,7 +326,10 @@ Scrolling is contained by the Surface clip area. It is safe to have dx and dy values that exceed the surface size. - The scroll flag can be ``0`` (normal behavior) or: + The scroll flag can be: + * ``0`` (default): the pixels are shifted but previous pixels are + not modified. + * ``pygame.SCROLL_ERASE``: the space created by the shifting pixels is filled with black or transparency. diff --git a/src_c/surface.c b/src_c/surface.c index 12d7940b16..fea4ad88be 100644 --- a/src_c/surface.c +++ b/src_c/surface.c @@ -2529,9 +2529,7 @@ surf_scroll(PyObject *self, PyObject *args, PyObject *keywds) } if (scroll(surf, dx, dy, x, y, w, h, repeat, erase) < 0) { - if (!pgSurface_Unlock((pgSurfaceObject *)self)) { - return NULL; - } + pgSurface_Unlock((pgSurfaceObject *)self); return NULL; }