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. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
A simple graphics rectangle? My coordinates are wrong - StephenG1CMZ - 06-01-2016, 11:16 PM
RE: A simple graphics rectangle? My coordinates are wrong - cyrille de brébisson - 06-02-2016, 05:28 AM
RE: A simple graphics rectangle? My coordinates are wrong - StephenG1CMZ - 06-02-2016, 06:42 AM
RE: A simple graphics rectangle? My coordinates are wrong - Claudio L. - 06-03-2016 05:46 PM
RE: A simple graphics rectangle? My coordinates are wrong - StephenG1CMZ - 06-05-2016, 08:35 AM
RE: A simple graphics rectangle? My coordinates are wrong - Arno K - 06-05-2016, 12:15 PM
RE: A simple graphics rectangle? My coordinates are wrong - Arno K - 06-05-2016, 08:46 PM
|
User(s) browsing this thread: 1 Guest(s)