Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MaximInterface
Diff: Rectangle.cpp
- Revision:
- 10:71359af61af8
- Parent:
- 8:a0d75dff3c9b
- Child:
- 13:6a6225690c2e
--- a/Rectangle.cpp Thu Apr 06 15:19:57 2017 -0500 +++ b/Rectangle.cpp Mon Apr 10 11:55:33 2017 -0500 @@ -31,6 +31,7 @@ *******************************************************************************/ #include <algorithm> +#include "Bitmap.hpp" #include "Rectangle.hpp" static const int minBorderWidth = 1; @@ -43,18 +44,18 @@ invalidate(); } -void Rectangle::doRender(Bitmap & bitmap) const +void Rectangle::doRender(Bitmap & bitmap, int xOffset, int yOffset) const { for (int curX = 0; (curX < width()) && (curX < bitmap.width()); curX++) { - for (int curY = 0; (curY <= height()) && (curY < bitmap.height()); curY++) + for (int curY = 0; (curY < height()) && (curY < bitmap.height()); curY++) { if ((curX < borderWidth()) || (curX >= (width() - borderWidth())) || (curY < borderWidth()) || (curY >= (height() - borderWidth()))) { - bitmap.setPixelEnabled(curX, curY, true); + bitmap.setPixelEnabled(xOffset + x() + curX, yOffset + y() + curY, true); } } }