mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Refactor code for annotations
This commit is contained in:
parent
e5b5c94925
commit
f8f4b3f45d
39 changed files with 667 additions and 499 deletions
|
@ -1476,24 +1476,12 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
},
|
||||
|
||||
beginAnnotation: function CanvasGraphics_beginAnnotation(rect, transform,
|
||||
matrix, border) {
|
||||
matrix) {
|
||||
this.save();
|
||||
|
||||
if (rect && isArray(rect) && 4 == rect.length) {
|
||||
var width = rect[2] - rect[0];
|
||||
var height = rect[3] - rect[1];
|
||||
|
||||
if (border) {
|
||||
// TODO(mack): Support different border styles
|
||||
this.save();
|
||||
var rgb = border.rgb;
|
||||
this.setStrokeRGBColor(rgb[0], rgb[1], rgb[2]);
|
||||
this.setLineWidth(border.width);
|
||||
this.rectangle(rect[0], rect[1], width, height);
|
||||
this.stroke();
|
||||
this.restore();
|
||||
}
|
||||
|
||||
this.rectangle(rect[0], rect[1], width, height);
|
||||
this.clip();
|
||||
this.endPath();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue