Open Bug 557522 Opened 15 years ago Updated 3 years ago

canvas scales images with a 1px width weirdly

Categories

(Core :: Graphics, defect)

1.9.0 Branch
x86
Windows XP
defect

Tracking

()

People

(Reporter: ma.mazmaz, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (.NET CLR 3.5.30729) If one tries to scale an image with an initial width of 1px, then the image looks weird on the canvas and is semi-transparent. Reproducible: Always Steps to Reproduce: Use the following code: <!DOCTYPE HTML> <html> <head> <title>Test</title> <script type="text/javascript"> window.onload=function(){ window.can=document.getElementById("can"); window.ctx=can.getContext('2d'); window.img=new Image(); img.onload=function(){ ctx.drawImage(img,0,0,800,img.height); }; img.src="http://maz.github.com/OpenBear/ob/themes/Default/selection.png"; }; </script> </head> <body> <h1>What happens:</h1><br/> <canvas id="can" width="800" height="100" style="background-color:red"></canvas> <h1>What should happen:<h1> <img src="http://maz.github.com/OpenBear/ob/themes/Default/selection.png" style="background-color:red" alt="an image" height="36" width="800"/> </body> </html> Actual Results: The image scaled with the canvas looks bad (and is scaled improperly).
Component: General → Canvas: 2D
Product: Firefox → Core
QA Contact: general → canvas.2d
Version: unspecified → 1.9.0 Branch
Worksforme on Mac, but I definitely see this on Windows.
Status: UNCONFIRMED → NEW
Component: Canvas: 2D → Graphics
Ever confirmed: true
QA Contact: canvas.2d → thebes
Presumably because we don't use EXTEND_PAD in canvas?
I can't really think of any reason. Vlad?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.