Skip to content

Commit

Permalink
Clip dirty region to be within viewport in MarkViewportDirty
Browse files Browse the repository at this point in the history
  • Loading branch information
JGRennison committed May 26, 2018
1 parent e6e5a96 commit 7f32bb3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2822,9 +2822,11 @@ static void MarkViewportDirty(const ViewPort * const vp, int left, int top, int

right -= vp->virtual_left;
if (right <= 0) return;
right = min(right, vp->virtual_width);

bottom -= vp->virtual_top;
if (bottom <= 0) return;
bottom = min(bottom, vp->virtual_height);

left = max(0, left - vp->virtual_left);

Expand Down

0 comments on commit 7f32bb3

Please sign in to comment.