FourthStone wrote:I am trying to wrap my head around how rectangles and filled rectangles operate, I've noticed that a rectangle fill using the same coords as a rectangle doesn't completely fill in the same area.
answer your question? In particular: "Solid shapes, such as filled triangles, rectangles and parallelograms, are drawn using the Windows™ Polygon function. This function treats the supplied vertices in a special way: vertices to the left and top of the polygon are inclusive of the plotted shape whereas vertices to the right and bottom are exclusive
Going right back to the BBC Micro there have been ambiguities about precisely what plot commands should do, even things as fundamental as whether the supplied parameters are true coordinates or pixel 'indices'. For example a graphics viewport filling the entire screen might need to be specified as 0;0;1276;1020; rather than 0;0;1280;1024;
As it says in the BB4W docs, I decided to sidestep the entire issue by converting the BBC BASIC coordinates into Windows coordinates in the most straightforward and 'obvious' way, thus leaving it up to the Windows GDI subsystem to determine precisely what happens. You can argue that it was a bit of a cop-out, and it does result in differences between platforms at the individual pixel level, but it makes it easier to mix PLOT and VDU commands with native Windows graphics. Similarly in the SDL version the graphics are drawn using the SDL_gfx subsystem and again one cannot expect that the pixels plotted will be precisely the same as they are on other platforms.
In a perfect world graphics coordinates should be floating-point values rather than integers, and all graphics should be plotted anti-aliased in order to achieve sub-pixel sizes and positions. This ideal is approached by the Windows GDI+ subsystem (GDIPLUS.DLL) and I would have liked to use this in BB4W had it not been for one serious problem: GDI+ does not support the 'logical' (OR, AND, XOR) plotting modes that are required by BBC BASIC.
One compensation is that screen resolutions are increasing all the time, with 'retina' displays with 300 DPI or better native resolution becoming commonplace. This means that 'off by one pixel' errors are far less important than they once were, and indeed the whole idea of drawing a line or curve which is one-pixel thick is a nonsense because it is likely to be invisible.