Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src_c/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -2780,12 +2780,12 @@ scroll_repeat(int h, int dx, int dy, int pitch, int span, int xoffset,
while (h--) {
if (dx > 0) {
memcpy(tempbuf, linesrc + span - xoffset, xoffset);
memcpy(linesrc + xoffset, linesrc, span - xoffset);
memmove(linesrc + xoffset, linesrc, span - xoffset);
memcpy(linesrc, tempbuf, xoffset);
}
else if (dx < 0) {
memcpy(tempbuf, linesrc, -xoffset);
memcpy(linesrc, linesrc - xoffset, span + xoffset);
memmove(linesrc, linesrc - xoffset, span + xoffset);
memcpy(linesrc + span + xoffset, tempbuf, -xoffset);
}
linesrc += pitch;
Expand Down Expand Up @@ -2835,13 +2835,13 @@ scroll_default(int h, int dx, int dy, int pitch, int span, int xoffset,
// No y-shifting, we only need to move pixels on the same line
while (h--) {
if (dx > 0) {
memcpy(linesrc + xoffset, linesrc, span - xoffset);
memmove(linesrc + xoffset, linesrc, span - xoffset);
if (erase) {
memset(linesrc, 0, xoffset);
}
}
else if (dx < 0) {
memcpy(linesrc, linesrc - xoffset, span + xoffset);
memmove(linesrc, linesrc - xoffset, span + xoffset);
if (erase) {
memset(linesrc + span + xoffset, 0, -xoffset);
}
Expand Down
Loading