mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix: don't apply text shadows on elements (#1795)
* Fix for Issue-1638 (https://github.com/niklasvh/html2canvas/issues/1638) Resolution: Clearing the Shadow Properties after they are consumed
This commit is contained in:
parent
7027900f49
commit
397595afb5
@ -235,6 +235,11 @@ export default class CanvasRenderer implements RenderTarget<HTMLCanvasElement> {
|
||||
text.bounds.top + text.bounds.height
|
||||
);
|
||||
});
|
||||
|
||||
this.ctx.shadowColor = '';
|
||||
this.ctx.shadowOffsetX = 0;
|
||||
this.ctx.shadowOffsetY = 0;
|
||||
this.ctx.shadowBlur = 0;
|
||||
} else {
|
||||
this.ctx.fillText(
|
||||
text.text,
|
||||
|
@ -50,6 +50,18 @@
|
||||
<span>testing with transparent</span>
|
||||
<strong>testing with low opacity</strong>
|
||||
</div>
|
||||
|
||||
<div id="capture" style="padding: 10px; background: #f5da55; border:2px solid blue;">
|
||||
<h4 style="color: #000;text-shadow:0px 0px 5px green;">Hello world!</h4>
|
||||
<div id="sampleDiv" style="border:2px solid red;padding:5px;margin:5px;">Sample Div with Border</div>
|
||||
<div style="border:2px solid red;background-color:pink; padding:5px;margin:5px;">Sample Div with Border</div>
|
||||
<div style="border:2px solid red;color:blue; padding:5px;margin:5px;">Sample Div with Border</div>
|
||||
<div style="border:2px solid red;padding:5px;margin:5px;">Sample Div with Border</div>
|
||||
<div style="border:2px solid red;padding:5px;text-shadow:0px 0px 5px red;margin:5px;">Sample Div with Border</div>
|
||||
<div style="border:2px solid red;padding:5px;margin:5px;">Sample Div with Border</div>
|
||||
<div style="border:2px solid red;padding:5px;margin:5px;">Sample Div with Border</div>
|
||||
</div>
|
||||
|
||||
<p class="white-text-with-blue-shadow">Sed ut perspiciatis unde omnis iste
|
||||
natus error sit voluptatem accusantium doloremque laudantium,
|
||||
totam rem aperiam, eaque ipsa quae ab illo inventore.</p>
|
||||
|
Loading…
Reference in New Issue
Block a user