Commit ed252626 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos

Use EvPage instead of a render context to get the selection map

Selection map doesn't depend on scale/rotation so only the page is
needed.
parent ea6eb7eb
......@@ -2012,15 +2012,15 @@ pdf_selection_get_selection_region (EvSelection *selection,
}
static GdkRegion *
pdf_selection_get_selection_map (EvSelection *selection,
EvRenderContext *rc)
pdf_selection_get_selection_map (EvSelection *selection,
EvPage *page)
{
PopplerPage *poppler_page;
PopplerRectangle points;
GList *region;
GdkRegion *retval;
poppler_page = POPPLER_PAGE (rc->page->backend_page);
poppler_page = POPPLER_PAGE (page->backend_page);
points.x1 = 0.0;
points.y1 = 0.0;
......
......@@ -77,13 +77,13 @@ ev_selection_get_selection_region (EvSelection *selection,
}
GdkRegion *
ev_selection_get_selection_map (EvSelection *selection,
EvRenderContext *rc)
ev_selection_get_selection_map (EvSelection *selection,
EvPage *page)
{
EvSelectionIface *iface = EV_SELECTION_GET_IFACE (selection);
if (!iface->get_selection_map)
return NULL;
return iface->get_selection_map (selection, rc);
return iface->get_selection_map (selection, page);
}
......@@ -65,7 +65,7 @@ struct _EvSelectionIface
EvSelectionStyle style,
EvRectangle *points);
GdkRegion * (* get_selection_map) (EvSelection *selection,
EvRenderContext *rc);
EvPage *page);
GdkRegion * (* get_selection_region) (EvSelection *selection,
EvRenderContext *rc,
EvSelectionStyle style,
......@@ -86,7 +86,7 @@ gchar *ev_selection_get_selected_text (EvSelection *selection,
EvSelectionStyle style,
EvRectangle *points);
GdkRegion *ev_selection_get_selection_map (EvSelection *selection,
EvRenderContext *rc);
EvPage *page);
GdkRegion *ev_selection_get_selection_region (EvSelection *selection,
EvRenderContext *rc,
EvSelectionStyle style,
......
......@@ -553,7 +553,7 @@ ev_job_render_run (EvJob *job)
if ((job_render->flags & EV_RENDER_INCLUDE_TEXT) && EV_IS_SELECTION (job->document))
job_render->text_mapping =
ev_selection_get_selection_map (EV_SELECTION (job->document), rc);
ev_selection_get_selection_map (EV_SELECTION (job->document), job_render->ev_page);
if ((job_render->flags & EV_RENDER_INCLUDE_LINKS) && EV_IS_DOCUMENT_LINKS (job->document))
job_render->link_mapping =
ev_document_links_get_links (EV_DOCUMENT_LINKS (job->document), job_render->page);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment