[Poppler-bugs] [Bug 70981] glib-demo: Add support for simple line annotations

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Nov 19 09:13:37 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=70981

--- Comment #21 from Carlos Garcia Campos <carlosgc at gnome.org> ---
Comment on attachment 89391
  --> https://bugs.freedesktop.org/attachment.cgi?id=89391
glib-demo: add color selection for new annotations

Review of attachment 89391:
-----------------------------------------------------------------

Looks great, thanks! I've pushed it to git master with some minor
modifications.

::: glib/demo/annots.c
@@ +663,3 @@
>  {
> +    GtkTreeIter      iter;
> +    GtkTreePath      *path;

This is only used inside the if (selected) block, so it could be moved there.

@@ +846,4 @@
>  pgd_annots_add_annot (PgdAnnotsDemo *demo)
>  {
>      PopplerRectangle  rect;
> +    PopplerPoint      start, end;

This is only used for line annots, so it can be moved to the case
POPPLER_ANNOT_LINE: block.

@@ +880,3 @@
>      g_object_unref (annot);
> +
> +    pgd_annots_viewer_queue_redraw (demo);

This is already called right after pgd_annots_add_annot

@@ +1013,5 @@
> +    demo->stop.y = event->y;
> +
> +    PopplerRectangle rect;
> +    PopplerPoint start, end;
> +    gdouble width, height;

Declarations block should be at the beginning of the function body.

@@ +1052,2 @@
>  
>      demo->start.x = -1;

This could be moved to the finish_add_annot method.

@@ +1054,5 @@
>  
> +	if (demo->annotations_idle > 0) {
> +		g_source_remove (demo->annotations_idle);
> +		demo->annotations_idle = 0;
> +	}

finish_add_annot schedules a new redraw, so if there's a pending redraw, it's
better to not cancel it here.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20131119/e9b6dccd/attachment-0001.html>


More information about the Poppler-bugs mailing list