Merge pull request #6215 from timvandermeij/annotation-border-fixes
More cleanup regarding annotation border styles
This commit is contained in:
commit
7065c1b8e9
@ -160,7 +160,6 @@ var Annotation = (function AnnotationClosure() {
|
||||
this.borderStyle.setHorizontalCornerRadius(array[0]);
|
||||
this.borderStyle.setVerticalCornerRadius(array[1]);
|
||||
this.borderStyle.setWidth(array[2]);
|
||||
this.borderStyle.setStyle('S');
|
||||
|
||||
if (array.length === 4) { // Dash array available
|
||||
this.borderStyle.setDashArray(array[3]);
|
||||
|
@ -45,7 +45,7 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
|
||||
style.fontFamily = fontFamily + fallbackName;
|
||||
}
|
||||
|
||||
function initContainer(item, drawBorder) {
|
||||
function initContainer(item) {
|
||||
var container = document.createElement('section');
|
||||
var cstyle = container.style;
|
||||
var width = item.rect[2] - item.rect[0];
|
||||
@ -149,7 +149,7 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
|
||||
rect[2] = rect[0] + (rect[3] - rect[1]); // make it square
|
||||
}
|
||||
|
||||
var container = initContainer(item, false);
|
||||
var container = initContainer(item);
|
||||
container.className = 'annotText';
|
||||
|
||||
var image = document.createElement('img');
|
||||
@ -256,7 +256,7 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
|
||||
}
|
||||
|
||||
function getHtmlElementForLinkAnnotation(item) {
|
||||
var container = initContainer(item, true);
|
||||
var container = initContainer(item);
|
||||
container.className = 'annotLink';
|
||||
|
||||
var link = document.createElement('a');
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
|
||||
/* globals expect, it, describe, Dict, Annotation, AnnotationBorderStyle,
|
||||
/* globals expect, it, describe, Dict, Name, Annotation, AnnotationBorderStyle,
|
||||
AnnotationBorderStyleType */
|
||||
|
||||
'use strict';
|
||||
@ -79,9 +79,7 @@ describe('Annotation layer', function() {
|
||||
|
||||
it('should set and get a valid style', function() {
|
||||
var borderStyle = new AnnotationBorderStyle();
|
||||
var dict = new Dict();
|
||||
dict.name = 'D';
|
||||
borderStyle.setStyle(dict);
|
||||
borderStyle.setStyle(Name.get('D'));
|
||||
|
||||
expect(borderStyle.style).toEqual(AnnotationBorderStyleType.DASHED);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user