aboutsummaryrefslogtreecommitdiffstats
path: root/src/gdisp
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-02-01 16:04:07 +0100
committerJoel Bodenmann <joel@unormal.org>2014-02-01 16:04:07 +0100
commit2a0dfcf1c141640aa4936dc8a8b6272b654e87e7 (patch)
tree8839e6a5065ecf33ba2cd5d47c4cbaeaa254b369 /src/gdisp
parent55ced68fbd282f5f91df22e2b03bac8be996dfb5 (diff)
downloaduGFX-2a0dfcf1c141640aa4936dc8a8b6272b654e87e7.tar.gz
uGFX-2a0dfcf1c141640aa4936dc8a8b6272b654e87e7.tar.bz2
uGFX-2a0dfcf1c141640aa4936dc8a8b6272b654e87e7.zip
fixed clipping issue when widget text is long than the widget itself
Diffstat (limited to 'src/gdisp')
-rw-r--r--src/gdisp/gdisp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index bb642b30..13f2eda2 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -2764,7 +2764,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
#if GDISP_NEED_ANTIALIAS && GDISP_HARDWARE_PIXELREAD
static void drawcharline(int16_t x, int16_t y, uint8_t count, uint8_t alpha, void *state) {
#define GD ((GDisplay *)state)
- if (y < GD->t.clipy0 || y >= GD->t.clipy1 || x < GD->t.clipx0 || x+count > GD->t.clipx1) return;
+ if (y < GD->t.clipy0 || y >= GD->t.clipy1)
+ return;
if (alpha == 255) {
GD->p.x = x; GD->p.y = y; GD->p.x1 = x+count-1; GD->p.color = GD->t.color;
hline_clip(GD);
@@ -2780,7 +2781,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
#else
static void drawcharline(int16_t x, int16_t y, uint8_t count, uint8_t alpha, void *state) {
#define GD ((GDisplay *)state)
- if (y < GD->t.clipy0 || y >= GD->t.clipy1 || x < GD->t.clipx0 || x+count > GD->t.clipx1) return;
+ if (y < GD->t.clipy0 || y >= GD->t.clipy1)
+ return;
if (alpha > 0x80) { // A best approximation when using anti-aliased fonts but we can't actually draw them anti-aliased
GD->p.x = x; GD->p.y = y; GD->p.x1 = x+count-1; GD->p.color = GD->t.color;
hline_clip(GD);
@@ -2792,7 +2794,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
#if GDISP_NEED_ANTIALIAS
static void fillcharline(int16_t x, int16_t y, uint8_t count, uint8_t alpha, void *state) {
#define GD ((GDisplay *)state)
- if (y < GD->t.clipy0 || y >= GD->t.clipy1 || x < GD->t.clipx0 || x+count > GD->t.clipx1) return;
+ if (y < GD->t.clipy0 || y >= GD->t.clipy1)
+ return;
if (alpha == 255) {
GD->p.color = GD->t.color;
} else {