mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1177726 - Inflate the bounds when stroking the canvas text. r=jmuizelaar
This commit is contained in:
parent
59b0d0f7d5
commit
febc152155
@ -3555,12 +3555,18 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
||||
buffer.mGlyphs = &glyphBuf.front();
|
||||
buffer.mNumGlyphs = 1;
|
||||
const ContextState& state = *mState;
|
||||
AdjustedTarget target(mCtx, &bounds);
|
||||
|
||||
const StrokeOptions strokeOpts(state.lineWidth, state.lineJoin,
|
||||
state.lineCap, state.miterLimit,
|
||||
state.dash.Length(),
|
||||
state.dash.Elements(),
|
||||
state.dashOffset);
|
||||
|
||||
// We need to adjust the bounds for the adjusted target
|
||||
bounds.Inflate(MaxStrokeExtents(strokeOpts, mCtx->mTarget->GetTransform()));
|
||||
|
||||
AdjustedTarget target(mCtx, &bounds);
|
||||
|
||||
CanvasGeneralPattern cgp;
|
||||
const Pattern& patForStyle
|
||||
(cgp.ForStyle(mCtx, CanvasRenderingContext2D::Style::STROKE, mCtx->mTarget));
|
||||
|
24
dom/canvas/test/reftest/1177726-text-stroke-bounds-ref.html
Normal file
24
dom/canvas/test/reftest/1177726-text-stroke-bounds-ref.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase for bug 1177726</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<canvas id="c" width="400" height="200">
|
||||
<p>No canvas.</p>
|
||||
</canvas>
|
||||
|
||||
<script>
|
||||
var canvas = document.getElementsByTagName("canvas")[0];
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.font = "120px 'Helvetica'";
|
||||
ctx.lineWidth = 15;
|
||||
ctx.lineJoin = "round";
|
||||
|
||||
ctx.strokeText("Ehsan", 20, 110);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
28
dom/canvas/test/reftest/1177726-text-stroke-bounds.html
Normal file
28
dom/canvas/test/reftest/1177726-text-stroke-bounds.html
Normal file
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase for bug 1177726</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<canvas id="c" width="400" height="200">
|
||||
<p>No canvas.</p>
|
||||
</canvas>
|
||||
|
||||
<script>
|
||||
var canvas = document.getElementsByTagName("canvas")[0];
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.shadowColor = 'white';
|
||||
ctx.shadowOffsetX = 5;
|
||||
ctx.shadowOffsetY = 5;
|
||||
ctx.shadowBlur = 0;
|
||||
ctx.font = "120px 'Helvetica'";
|
||||
ctx.lineWidth = 15;
|
||||
ctx.lineJoin = "round";
|
||||
|
||||
ctx.strokeText("Ehsan", 20, 110);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -158,3 +158,5 @@ pref(canvas.customfocusring.enabled,true) skip-if(B2G) skip-if(Android&&AndroidV
|
||||
|
||||
# Check that captureStream() displays in a local video element
|
||||
pref(canvas.capturestream.enabled,true) skip-if(winWidget&&layersGPUAccelerated&&d2d) == capturestream.html wrapper.html?green.png
|
||||
|
||||
fuzzy-if(Android,3,40) == 1177726-text-stroke-bounds.html 1177726-text-stroke-bounds-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user