|
1 | 1 | from typing import TYPE_CHECKING, List, Optional, Tuple, Union |
2 | 2 |
|
| 3 | +from ..constants import AnnotationFlag |
3 | 4 | from ._base import ( |
4 | 5 | BooleanObject, |
5 | 6 | FloatObject, |
|
12 | 13 | from ._rectangle import RectangleObject |
13 | 14 | from ._utils import hex_to_rgb, logger_warning |
14 | 15 |
|
| 16 | +NO_FLAGS = AnnotationFlag(0) |
| 17 | + |
15 | 18 |
|
16 | 19 | def _get_bounding_rectangle(vertices: List[Tuple[float, float]]) -> RectangleObject: |
17 | 20 | x_min, y_min = vertices[0][0], vertices[0][1] |
@@ -145,8 +148,9 @@ def free_text( |
145 | 148 |
|
146 | 149 | @staticmethod |
147 | 150 | def popup( |
| 151 | + *, |
148 | 152 | rect: Union[RectangleObject, Tuple[float, float, float, float]], |
149 | | - flags: int = 0, |
| 153 | + flags: AnnotationFlag = NO_FLAGS, |
150 | 154 | parent: Optional[DictionaryObject] = None, |
151 | 155 | open: bool = False, |
152 | 156 | ) -> DictionaryObject: |
@@ -174,7 +178,7 @@ def popup( |
174 | 178 | NameObject("/Subtype"): NameObject("/Popup"), |
175 | 179 | NameObject("/Rect"): RectangleObject(rect), |
176 | 180 | NameObject("/Open"): BooleanObject(open), |
177 | | - NameObject("/Flags"): NumberObject(flags), |
| 181 | + NameObject("/F"): NumberObject(flags), |
178 | 182 | } |
179 | 183 | ) |
180 | 184 | if parent: |
|
0 commit comments