mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #6820 from Snuffleupagus/showText-shadingPattern
Apply Patterns, if necessary, when rendering text
This commit is contained in:
commit
30b8f41003
5 changed files with 23 additions and 0 deletions
|
@ -1421,6 +1421,12 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
ctx.transform.apply(ctx, current.textMatrix);
|
||||
ctx.translate(current.x, current.y + current.textRise);
|
||||
|
||||
if (current.patternFill) {
|
||||
// TODO: Some shading patterns are not applied correctly to text,
|
||||
// e.g. issues 3988 and 5432, and ShowText-ShadingPattern.pdf.
|
||||
ctx.fillStyle = current.fillColor.getPattern(ctx, this);
|
||||
}
|
||||
|
||||
if (fontDirection > 0) {
|
||||
ctx.scale(textHScale, -1);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue