Closed Bug 293226 Opened 21 years ago Closed 21 years ago

Antialiasing uses wrong colors with strokeRect() on Canvas element

Categories

(Core :: Graphics: Canvas2D, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 293353

People

(Reporter: jens.b, Unassigned)

Details

(Keywords: testcase)

Attachments

(4 files, 3 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050506 Firefox/1.0+ When drawing stroked rectangles with non-even values for .lineWidth, the display antialiasing uses wrong colors for white and gray backgrounds. No idea whether this is canvas-specific or a general bug in the graphics backend. Reproducible: Always Steps to Reproduce: 1. Load attached testcase 2. Switch to different background colors using the provided links Actual Results: For gray and white backgrounds, antialiasing is performed using some dark cyan colors around rgb(135,191,199). For red, green and blue backgrounds, things look okay. Expected Results: It should have used some clean gray colors for antialiasing.
Additional observation: at the lower left and lower right corners, a bright green pixel appears inside the rectangle - on all backgrounds, see the screenshots.
Keywords: testcase
Since Gecko/20050507, the canvas no longer seems to be transparent by default, so it doesn't pick up the body's bgcolor any longer (bug 293259). This is an updated patch that directly styles the canvas itself (which won't work in older builds due to bug bug 291262).
Attachment #182851 - Attachment is obsolete: true
Attachment #182853 - Attachment is obsolete: true
Attachment #182854 - Attachment is obsolete: true
With bug 293219 (RGB order mixup) being fixed now, the dark cyan color is replaced with some light brown/dark orange color around rgb(199,191,135). Related question: is the fact that a 1-pixel black rectangle is not drawn as straight black line but some antialiased, two-pixel line the intended behaviour, or a bug that should be filed?
> is the fact that a 1-pixel black rectangle is not drawn as straight black line but some antialiased, two-pixel line the intended behaviour Yes, I think so. The coordinates are pixel boundaries, i.e. (0,0) is the top left corner of the top left pixel, not the center of the top left pixel. So a 1 pixel line on a pixel boundary means 2 half pixel width lines on both side of the boundary, which is rendered as 2 50% transparent 1 pixel width lines.
see bug 293353#c11 VC6. (beast) is bad, VC7.1 (vlad's) WFM
I know, I know, this bug has a lower bug #. But the other one is set blocking, blah blah blah. *** This bug has been marked as a duplicate of 293353 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: