Refactor code for annotations

This commit is contained in:
Mack Duan 2013-03-21 01:04:44 -07:00
parent e5b5c94925
commit f8f4b3f45d
39 changed files with 667 additions and 499 deletions

View file

@ -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();