summaryrefslogtreecommitdiff
path: root/platform/gl/gl-annotate.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform/gl/gl-annotate.c')
-rw-r--r--platform/gl/gl-annotate.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/platform/gl/gl-annotate.c b/platform/gl/gl-annotate.c
index 1cfe4544..48f0555e 100644
--- a/platform/gl/gl-annotate.c
+++ b/platform/gl/gl-annotate.c
@@ -461,7 +461,8 @@ void do_annotate_panel(void)
n = 0;
for (annot = pdf_first_annot(ctx, page); annot; annot = pdf_next_annot(ctx, annot))
- ++n;
+ if (pdf_annot_type(ctx, annot) != PDF_ANNOT_WIDGET)
+ ++n;
ui_list_begin(&annot_list, n, 0, ui.lineheight * 10 + 4);
for (annot = pdf_first_annot(ctx, page); annot; annot = pdf_next_annot(ctx, annot))
@@ -469,15 +470,12 @@ void do_annotate_panel(void)
char buf[256];
int num = pdf_to_num(ctx, annot->obj);
enum pdf_annot_type subtype = pdf_annot_type(ctx, annot);
- if (subtype == PDF_ANNOT_WIDGET)
+ if (subtype != PDF_ANNOT_WIDGET)
{
- pdf_obj *ft = pdf_dict_get_inheritable(ctx, annot->obj, PDF_NAME(FT));
- fz_snprintf(buf, sizeof buf, "%d: Widget %s", num, pdf_to_name(ctx, ft));
- }
- else
fz_snprintf(buf, sizeof buf, "%d: %s", num, pdf_string_from_annot_type(ctx, subtype));
- if (ui_list_item(&annot_list, annot->obj, buf, selected_annot == annot))
- selected_annot = annot;
+ if (ui_list_item(&annot_list, annot->obj, buf, selected_annot == annot))
+ selected_annot = annot;
+ }
}
ui_list_end(&annot_list);
@@ -515,10 +513,7 @@ void do_annotate_panel(void)
ui_spacer();
- if (subtype == PDF_ANNOT_WIDGET)
- do_widget_panel();
- else
- do_annotate_contents();
+ do_annotate_contents();
ui_spacer();
@@ -1062,6 +1057,10 @@ void do_annotate_canvas(fz_irect canvas_area)
for (annot = pdf_first_annot(ctx, page); annot; annot = pdf_next_annot(ctx, annot))
{
+ enum pdf_annot_type subtype = pdf_annot_type(ctx, annot);
+ if (subtype == PDF_ANNOT_WIDGET)
+ continue;
+
bounds = pdf_bound_annot(ctx, annot);
bounds = fz_transform_rect(bounds, view_page_ctm);
area = fz_irect_from_rect(bounds);
@@ -1078,7 +1077,7 @@ void do_annotate_canvas(fz_irect canvas_area)
if (annot == selected_annot)
{
- switch (pdf_annot_type(ctx, selected_annot))
+ switch (subtype)
{
default:
break;