LineWidth Issue
Moderator: Klaus
LineWidth Issue
The attached stack draws a color gradient between two colors, one line at a time. The number of lines in the gradient is the height of the graphic object. The "lineWidth" is set to either 1 or 2. A line size of one, which should fill the graphic, instead only draws every other line visually, although the number of lines it says it drew matches the graphic object height. If "lineWidth" is set to 2, it appears correct. Nothing in the documentation explains this result.
Is this considered bug, or am I missing a setting?
Thanks, Walt
Additional note: When it uses a slow draw speed, it only spends half the time drawing within the graphic - in other words it appears to alternate between drawing a line within the graphic then drawing a line somewhere else. I could not spot an error in the code that might make it do that.
Is this considered bug, or am I missing a setting?
Thanks, Walt
Additional note: When it uses a slow draw speed, it only spends half the time drawing within the graphic - in other words it appears to alternate between drawing a line within the graphic then drawing a line somewhere else. I could not spot an error in the code that might make it do that.
- Attachments
-
- idLineWidthTest703.zip
- (13.4 KiB) Downloaded 242 times
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: LineWidth Issue
Here's a new version which has a log field. In both cases of lineWidth (1 and 2 pixels) the same number of lines are drawn, but when drawn with a slow dragSpeed, it appears that every second line is drawn out side the graphic, even though the coordinate values are correct.
- Attachments
-
- idLineWidthTest2.zip
- (14.35 KiB) Downloaded 231 times
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: LineWidth Issue
Aha!
A third version - this one you can select either the gradient colors to be drawn or random color selection for each line.
If you use a dragSpeed under say 1000, it is very informative. It appears that lines are only printing on alternate addresses, in other words a line is drawn (1 pixel wide) and the next line overprints it. The following line is then drawn two pixels down.
Added note: This only appears to occur at a line width of 1. Using even number wider line widths (and adding a step of the line width to the repeat loop) appears to work correctly. Odd number line widths leave a single line exposed. Changed to a version 4 of the test file.
Added note: I have gone through all my graphics card settings (NVIDIA) and tried all the interlacing options, and none changed the results.
A third version - this one you can select either the gradient colors to be drawn or random color selection for each line.
If you use a dragSpeed under say 1000, it is very informative. It appears that lines are only printing on alternate addresses, in other words a line is drawn (1 pixel wide) and the next line overprints it. The following line is then drawn two pixels down.
Added note: This only appears to occur at a line width of 1. Using even number wider line widths (and adding a step of the line width to the repeat loop) appears to work correctly. Odd number line widths leave a single line exposed. Changed to a version 4 of the test file.
Added note: I have gone through all my graphics card settings (NVIDIA) and tried all the interlacing options, and none changed the results.
- Attachments
-
- idLineWidthTest4.zip
- (13.88 KiB) Downloaded 231 times
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: LineWidth Issue
Our brains naturally assume that a pixel is a box and a width of 1 will fill that box. But coordinates are at the grid lines, not at the center of the box. The engine has to evaluate where to draw based on the coordinate at the upper left of the box. LC apparently solves the problem by rounding to the closest even (or maybe odd) coordinate.
A width of 2 draws from one grid line to the next and visually fills the (imaginary) box.
The solution to this is subpixel rendering, which we don't have yet.
A width of 2 draws from one grid line to the next and visually fills the (imaginary) box.
The solution to this is subpixel rendering, which we don't have yet.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: LineWidth Issue
Thanks Jacque. So there is A) no way to create a graphic at 1 pixel resolution, and B) that's not a bug or improvement required issue?
I do not believe subpixel rendering is the issue. I have 94 vertical addresses between top and bottom, the code executes 94 lines at 1 pixel width in the repeat loop, but 47 lines are drawn and overdrawn with an easily visible pixel width space between them. I could go to a 2 pixel line width but then I lose 50% of my vertical resolution. If it successfully draws a 2, 3, or n pixel wide line, it "knows" about individual pixel width. At 1 pixel line width, it is obviously doing something wrong if it can accurately overdraw the previous line then skip an equivalent space.
Additionally, LC accepts the 1 pixel line width, giving tacit support to that drawing resolution without throwing an error.
Walt
I do not believe subpixel rendering is the issue. I have 94 vertical addresses between top and bottom, the code executes 94 lines at 1 pixel width in the repeat loop, but 47 lines are drawn and overdrawn with an easily visible pixel width space between them. I could go to a 2 pixel line width but then I lose 50% of my vertical resolution. If it successfully draws a 2, 3, or n pixel wide line, it "knows" about individual pixel width. At 1 pixel line width, it is obviously doing something wrong if it can accurately overdraw the previous line then skip an equivalent space.
Additionally, LC accepts the 1 pixel line width, giving tacit support to that drawing resolution without throwing an error.
Walt
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: LineWidth Issue
Subpixel rendering wasn't really the right term I think, I'm not sure of the name for what I'm describing. I'd report it as a bug though and see what happens. It is possible to create a 1-pixel visible line, so there may be some other problem involved when you try to stack several of them close together.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: LineWidth Issue
Posted http://quality.runrev.com/show_bug.cgi?id=14793, with updated example stack with lots of ways to experiment.
- Attachments
-
- idLineWidthTest5.zip
- (56.92 KiB) Downloaded 236 times
Walt Brown
Omnis traductor traditor
Omnis traductor traditor