1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Widget annotations: simplify field flag handling

Directly use the hexadecimal representation, just like the
`AnnotationFlags`, to avoid calculations and to improve readability.
This allows us to simplify the unit tests for text widget annotations as
well.
This commit is contained in:
Tim van der Meij 2016-09-21 21:06:44 +02:00
parent 6100ab4b18
commit 375229d6b9
3 changed files with 33 additions and 47 deletions

View file

@ -678,14 +678,13 @@ var WidgetAnnotation = (function WidgetAnnotationClosure() {
*
* @public
* @memberof WidgetAnnotation
* @param {number} flag - Bit position, numbered from one instead of
* zero, to check
* @param {number} flag - Hexadecimal representation for an annotation
* field characteristic
* @return {boolean}
* @see {@link shared/util.js}
*/
hasFieldFlag: function WidgetAnnotation_hasFieldFlag(flag) {
var mask = 1 << (flag - 1);
return !!(this.data.fieldFlags & mask);
return !!(this.data.fieldFlags & flag);
},
});