Force default icon size for Text annotations without appearance stream

This commit is contained in:
Tim van der Meij 2014-04-18 21:11:56 +02:00
parent a0625ec0e5
commit 8d365b23ca

View File

@ -21,6 +21,7 @@
'use strict'; 'use strict';
var DEFAULT_ICON_SIZE = 22; // px
var HIGHLIGHT_OFFSET = 4; // px var HIGHLIGHT_OFFSET = 4; // px
var SUPPORTED_TYPES = ['Link', 'Text', 'Widget']; var SUPPORTED_TYPES = ['Link', 'Text', 'Widget'];
@ -624,6 +625,8 @@ var TextAnnotation = (function TextAnnotationClosure() {
if (data.hasAppearance) { if (data.hasAppearance) {
data.name = 'NoIcon'; data.name = 'NoIcon';
} else { } else {
data.rect[1] = data.rect[3] - DEFAULT_ICON_SIZE;
data.rect[2] = data.rect[0] + DEFAULT_ICON_SIZE;
data.name = dict.has('Name') ? dict.get('Name').name : 'Note'; data.name = dict.has('Name') ? dict.get('Name').name : 'Note';
} }