summaryrefslogtreecommitdiff
path: root/src/RasterGraphics.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-22 16:13:43 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-22 16:13:43 (GMT)
commite38fd405af5f07667203c6f584a5cdb00ed20ca2 (patch)
treef5630c0e43cb848bb36a29c0d20599dcc324161c /src/RasterGraphics.cpp
parent553cf6552070aae93e1db031b57afdc8c9ba19e0 (diff)
downloadpowder-e38fd405af5f07667203c6f584a5cdb00ed20ca2.zip
powder-e38fd405af5f07667203c6f584a5cdb00ed20ca2.tar.gz
Correct quirks with drawrect and fillrect, change UI components accordingly, shorten save name in save button
Diffstat (limited to 'src/RasterGraphics.cpp')
-rw-r--r--src/RasterGraphics.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/RasterGraphics.cpp b/src/RasterGraphics.cpp
index 472ae3c..563aef2 100644
--- a/src/RasterGraphics.cpp
+++ b/src/RasterGraphics.cpp
@@ -321,6 +321,8 @@ void Graphics::draw_line(int x1, int y1, int x2, int y2, int r, int g, int b, in
void Graphics::drawrect(int x, int y, int w, int h, int r, int g, int b, int a)
{
int i;
+ w--;
+ h--;
for (i=0; i<=w; i++)
{
blendpixel(x+i, y, r, g, b, a);
@@ -336,8 +338,8 @@ void Graphics::drawrect(int x, int y, int w, int h, int r, int g, int b, int a)
void Graphics::fillrect(int x, int y, int w, int h, int r, int g, int b, int a)
{
int i,j;
- for (j=1; j<h; j++)
- for (i=1; i<w; i++)
+ for (j=0; j<h; j++)
+ for (i=0; i<w; i++)
blendpixel(x+i, y+j, r, g, b, a);
}