PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Bug in GapiDrawExtension.h

Hello

I found a bug in the class CRect implemented in GapiDrawExtension.h of GapiDraw 301b
the 2 function members MoveToX and MoveToY compute invalid coordinates for the member "right" of the class,
in MoveToX(long x) for example, the value x is assigned to the member left, then the value x + GetWidth() is assigned to right. the problem is that left is changed before the call to GetWidth() that returns the value right - left, which in this case is equivalent to returning right - x. this means right = x + (right - x) = right :!:
the same is for the function MoveToY(long y)
I solved the problem by swapping the two instructions of each of the 2 functions
Thanks! I have updated the files and it will be updated in GapiDraw 3.01c due out shortly.