From bea6140789bee5ed90065589cf1b2aff1ed6612c Mon Sep 17 00:00:00 2001 From: BusinessmanProgrammerSteve Date: Fri, 12 Mar 2010 01:40:40 +0000 Subject: [PATCH] Fix a crash in TrackArtist::DrawLinkTiles() --- src/TrackArtist.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index 16f94c371..b3abb7c0e 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -2645,6 +2645,7 @@ void TrackArtist::DrawLinkTiles(wxDC *dc, wxRect r) wxBitmap sync(theTheme.Image(bmpLinkSelect)); int xOffset = r.x % sync.GetWidth(); + if (xOffset < 0) xOffset += sync.GetWidth(); int width; for (int x = 0; x < r.width; x += width) { width = sync.GetWidth() - xOffset; @@ -2652,6 +2653,7 @@ void TrackArtist::DrawLinkTiles(wxDC *dc, wxRect r) width = r.width - x; int yOffset = r.y % sync.GetHeight(); + if (yOffset < 0) yOffset += sync.GetWidth(); int height; for (int y = 0; y < r.height; y += height) { height = sync.GetHeight() - yOffset;