LCD LIB
Fork of RA8875 by
Revision 114:dbfb996bfbf3, committed 2016-05-15
- Comitter:
- WiredHome
- Date:
- Sun May 15 18:57:06 2016 +0000
- Parent:
- 112:325ca91bc03d
- Child:
- 115:c9862fd0c689
- Commit message:
- Minor doc changes, and enable the GraphicsDisplay::window( ) to have no parameters to reset the screen size to full.
Changed in this revision
--- a/GraphicsDisplay.cpp Wed Apr 27 01:29:55 2016 +0000 +++ b/GraphicsDisplay.cpp Sun May 15 18:57:06 2016 +0000 @@ -105,13 +105,18 @@ return window(r.p1.x, r.p1.y, r.p2.x + 1 - r.p1.x, r.p2.y + 1 - r.p1.y); } -RetCode_t GraphicsDisplay::window(loc_t x, loc_t y, dim_t width, dim_t height) +RetCode_t GraphicsDisplay::window(loc_t x, loc_t y, dim_t _width, dim_t _height) { + if (_width == (dim_t)-1) + _width = width() - x; + if (_height == (dim_t)-1) + _height = height() - y; + // Save the window metrics windowrect.p1.x = x; windowrect.p1.y = y; - windowrect.p2.x = x + width - 1; - windowrect.p2.y = y + height - 1; + windowrect.p2.x = x + _width - 1; + windowrect.p2.y = y + _height - 1; // current pixel location _x = x; _y = y;
--- a/GraphicsDisplay.h Wed Apr 27 01:29:55 2016 +0000 +++ b/GraphicsDisplay.h Sun May 15 18:57:06 2016 +0000 @@ -152,13 +152,15 @@ /// and down a row. If the initial write is outside the window, it will /// be captured into the window when it crosses a boundary. /// + /// @note if no parameters are provided, it restores the window to full screen. + /// /// @param[in] x is the left edge in pixels. /// @param[in] y is the top edge in pixels. /// @param[in] w is the window width in pixels. /// @param[in] h is the window height in pixels. /// @returns success/failure code. @see RetCode_t. /// - virtual RetCode_t window(loc_t x, loc_t y, dim_t w, dim_t h); + virtual RetCode_t window(loc_t x = 0, loc_t y = 0, dim_t w = (dim_t)-1, dim_t h = (dim_t)-1); /// method to set the window region to the full screen. ///
--- a/RA8875.h Wed Apr 27 01:29:55 2016 +0000 +++ b/RA8875.h Sun May 15 18:57:06 2016 +0000 @@ -1240,6 +1240,8 @@ /// one row and from the bottom to the top. Graphics drawing will be clipped /// at the edge of the window. /// + /// @note if no parameters are provided, it restores the window to full screen. + /// /// @note If the initial text write is outside the window, it will be shown /// where the cursor position it. Once the write hits the right edge of /// the defined window, it will then wrap back to the left edge. Once it