Merge pull request #2988 from mduan/annotation-refactor-tx

Refactor annotation code
This commit is contained in:
Yury Delendik 2013-05-09 06:09:14 -07:00
commit d92c3f8913
39 changed files with 674 additions and 499 deletions

View file

@ -1495,24 +1495,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();