From 1f003cf9e6a6318af036b8d1df70aa4d64ea6d05 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 4 May 2012 20:48:52 +0000 Subject: Updated NxWM widgets, several NX, NxWidgets, and NxWM bug fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4699 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/graphics/nxglib/fb/nxglib_moverectangle.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'nuttx/graphics/nxglib') diff --git a/nuttx/graphics/nxglib/fb/nxglib_moverectangle.c b/nuttx/graphics/nxglib/fb/nxglib_moverectangle.c index d1bcbe7c9..d8e52250c 100644 --- a/nuttx/graphics/nxglib/fb/nxglib_moverectangle.c +++ b/nuttx/graphics/nxglib/fb/nxglib_moverectangle.c @@ -1,8 +1,8 @@ /**************************************************************************** * graphics/nxglib/fb/nxglib_moverectangle.c * - * Copyright (C) 2008-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -185,14 +185,16 @@ void NXGL_FUNCNAME(nxgl_moverectangle,NXGLIB_SUFFIX) * source position. */ - dline = (FAR uint8_t*)sline - offset->y * stride - NXGL_SCALEX(offset->x); + dline = pinfo->fbmem + offset->y * stride + NXGL_SCALEX(offset->x); /* Case 1: Is the destination position above the displayed position? - * If the Y offset is negative, then the destination is offset to a - * postion below (or to the right) in the source in framebuffer memory. + * If the destination position is less then then the src address, then the + * destination is offset to a postion below (and or to the left) of the + * source in framebuffer memory. */ - if (offset->y < 0 || (offset->y == 0 && offset->x <= 0)) + if (offset->y < rect->pt1.y || + (offset->y < rect->pt1.y && offset->x <= rect->pt1.x)) { /* Yes.. Copy the rectangle from top down (i.e., adding the stride * to move to the next, lower row) */ -- cgit v1.2.3