mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Using setDash for dashed lines
This commit is contained in:
parent
bcbc21a51c
commit
a7f0e9612a
2 changed files with 16 additions and 8 deletions
|
@ -391,10 +391,14 @@ var tests = [
|
|||
ctx.moveTo(0,5);
|
||||
ctx.lineTo(50, 5);
|
||||
ctx.lineWidth = 10;
|
||||
ctx.mozDash = [10, 10];
|
||||
ctx.mozDashOffset = 0;
|
||||
ctx.webkitLineDash = [10, 10];
|
||||
ctx.webkitLineDashOffset = 0;
|
||||
|
||||
if ('setLineDash' in ctx) {
|
||||
ctx.setLineDash([10, 10]);
|
||||
ctx.lineDashOffset = 0;
|
||||
} else {
|
||||
ctx.mozDash = [10, 10];
|
||||
ctx.mozDashOffset = 0;
|
||||
}
|
||||
ctx.stroke();
|
||||
|
||||
var data = ctx.getImageData(0, 0, 50, 50).data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue