Maxim Integrated / Mbed OS MAXREFDES155#

Dependencies:   MaximInterface

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);
             }
         }
     }