зеркало из https://github.com/mozilla/pjs.git
Bug 478445 and bug 499628. strokeText needs to not re-stroke the current path. r=vlad, a=vlad
This commit is contained in:
Родитель
01bf8d9c4f
Коммит
8bfb93c8f3
|
@ -2799,9 +2799,11 @@ nsCanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
|
|||
|
||||
gfxContextPathAutoSaveRestore pathSR(mThebes, PR_FALSE);
|
||||
|
||||
// back up path if stroking
|
||||
if (aOp == nsCanvasRenderingContext2D::TEXT_DRAW_OPERATION_STROKE)
|
||||
// back up and clear path if stroking
|
||||
if (aOp == nsCanvasRenderingContext2D::TEXT_DRAW_OPERATION_STROKE) {
|
||||
pathSR.Save();
|
||||
mThebes->NewPath();
|
||||
}
|
||||
// doUseIntermediateSurface is mutually exclusive to op == STROKE
|
||||
else {
|
||||
if (doUseIntermediateSurface) {
|
||||
|
|
|
@ -39,3 +39,5 @@ asserts-if(cocoaWidget,0-2) == size-change-1.html size-change-1-ref.html
|
|||
== text-bidi-rtl-test.html text-bidi-rtl-ref.html
|
||||
|
||||
!= text-font-lang.html text-font-lang-notref.html
|
||||
|
||||
== strokeText-path.html strokeText-path-ref.html
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript"><!--
|
||||
window.onload = function () {
|
||||
var canvas = document.getElementById('testCanvas'),
|
||||
context = canvas.getContext('2d');
|
||||
|
||||
// draw some text
|
||||
context.font = 'bold 40px sans-serif';
|
||||
context.strokeText("Hello world!", 10, 50);
|
||||
};
|
||||
// --></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>You should see only see "Hello world!" below, without any additional
|
||||
line. JavaScript is required.</p>
|
||||
|
||||
<p><canvas id="testCanvas" width="400" height="300">You need Canvas
|
||||
support.</canvas></p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript"><!--
|
||||
window.onload = function () {
|
||||
var canvas = document.getElementById('testCanvas'),
|
||||
context = canvas.getContext('2d');
|
||||
|
||||
// draw a path
|
||||
context.beginPath();
|
||||
context.moveTo(10, 10);
|
||||
context.lineTo(200, 10);
|
||||
context.lineTo(200, 200);
|
||||
context.stroke();
|
||||
context.closePath();
|
||||
|
||||
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
// draw some text
|
||||
context.font = 'bold 40px sans-serif';
|
||||
context.strokeText("Hello world!", 10, 50);
|
||||
};
|
||||
// --></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>You should see only see "Hello world!" below, without any additional
|
||||
line. JavaScript is required.</p>
|
||||
|
||||
<p><canvas id="testCanvas" width="400" height="300">You need Canvas
|
||||
support.</canvas></p>
|
||||
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче