Post Reply 
A simple graphics rectangle? My coordinates are wrong
06-03-2016, 05:46 PM
Post: #4
RE: A simple graphics rectangle? My coordinates are wrong
(06-02-2016 05:28 AM)cyrille de brĂ©bisson Wrote:  RECT_P uses the top left and bottom right (included) coordinates.

(06-02-2016 06:42 AM)StephenG1CMZ Wrote:  If I understand it, the coordinate (255+border,YLEN+border) should not overlap the outer border at (255+2border,YLEN+2border) and overwrite the final border. I think I need to find a bug in my code or understanding.

I think your problem is in the definition above. It draws up to and including those coordinates.
So you go (0,0) to (255+2*BWIDTH,BWIDTH), then (0,BWIDTH) to (BWIDTH,YLEN+BWIDTH) for example.
The segment exactly at (0,BWIDTH) to (BWIDTH,BWIDTH) is included in both rectangles, therefore it's overlapping.
If you want your width to be 255 pixels and have BWIDTH border each side, you'll go:
from 0 to BWIDTH-1, then your main area goes from BWIDTH to 255+BWIDTH-1, and the final border from 255+BWIDTH to 255+2*BWIDTH-1.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: A simple graphics rectangle? My coordinates are wrong - Claudio L. - 06-03-2016 05:46 PM



User(s) browsing this thread: 1 Guest(s)