Closed
Bug 447599
Opened 17 years ago
Closed 17 years ago
mozMeasureText returns incorrect value
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: polzer, Unassigned)
References
()
Details
User-Agent: Opera/9.51 (X11; Linux i686; U; en)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008071111 IceCat/3.0
mozMeasureText returns incorrect values for me (see URL for the result of this JS fragment):
<div style="background:grey">
<canvas id="cv" width=300 height=200 style="background:red"/>
</div>
<script type="text/javascript">
var ctx = document.getElementById("cv").getContext("2d"),
text = "Foobar"
textWidth = ctx.mozMeasureText(text),
x = (ctx.canvas.width - textWidth)/2;
ctx.strokeRect(x, 100, textWidth, 1)
ctx.translate(x, 100);
ctx.mozDrawText(text);
Problem seems to be independent of zoom.
Reproducible: Always
Comment 1•17 years ago
|
||
WFM with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0 or Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a1pre) Gecko/2008072401 Minefield/3.1a1pre
Could you try with an official Firefox build to see if the issue is IceCat specific?
Component: General → Layout: Canvas
Product: Firefox → Core
QA Contact: general → layout.canvas
Version: unspecified → 1.9.0 Branch
| Reporter | ||
Comment 2•17 years ago
|
||
Broken too on
Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1
as expected.
| Reporter | ||
Comment 3•17 years ago
|
||
Suppose it's a bug that has been fixed in 3.1?
Comment 4•17 years ago
|
||
well, your testcase worked for me for both 3.0 and 3.1, so maybe it does not show on my system for some reasons (font configuration or other things), I tested on an Ubuntu 8.04. It would be interesting if you could test with a trunk build to know if this is fixed on 3.1.
| Reporter | ||
Comment 5•17 years ago
|
||
WFM in 3.1a1 Shiretoko.
closekthx.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Resolution: FIXED → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•