Skip to content

Commit

Permalink
Fix docs and remove redundant C code
Browse files Browse the repository at this point in the history
  • Loading branch information
damusss committed Oct 17, 2024
1 parent d6d7bf3 commit dc9042d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion docs/reST/ref/surface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 1 addition & 3 deletions src_c/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit dc9042d

Please sign in to comment.