Commit f01a9f27 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

crop tool: use low quality zoom for higher precision

[bug #654553]
parent 14e0b0c8
......@@ -530,6 +530,7 @@ gth_file_tool_crop_get_options (GthFileTool *base)
self);
gth_image_viewer_set_tool (GTH_IMAGE_VIEWER (viewer), (GthImageViewerTool *) self->priv->selector);
gth_image_viewer_set_zoom_quality (GTH_IMAGE_VIEWER (viewer), GTH_ZOOM_QUALITY_LOW);
gth_image_viewer_set_fit_mode (GTH_IMAGE_VIEWER (viewer), GTH_FIT_SIZE_IF_LARGER);
ratio_combobox_changed_cb (NULL, self);
......@@ -576,6 +577,7 @@ gth_file_tool_crop_destroy_options (GthFileTool *base)
viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
viewer = gth_image_viewer_page_get_image_viewer (GTH_IMAGE_VIEWER_PAGE (viewer_page));
gth_image_viewer_set_tool (GTH_IMAGE_VIEWER (viewer), NULL);
gth_image_viewer_set_zoom_quality (GTH_IMAGE_VIEWER (viewer), eel_gconf_get_enum (PREF_ZOOM_QUALITY, GTH_TYPE_ZOOM_QUALITY, GTH_ZOOM_QUALITY_HIGH));
}
......
......@@ -155,7 +155,6 @@ gth_image_dragger_expose (GthImageViewerTool *self,
{
GthImageDragger *dragger;
GthImageViewer *viewer;
cairo_filter_t filter;
dragger = (GthImageDragger *) self;
viewer = dragger->priv->viewer;
......@@ -165,14 +164,6 @@ gth_image_dragger_expose (GthImageViewerTool *self,
if (gth_image_viewer_get_current_image (viewer) == NULL)
return;
if (gth_image_viewer_get_zoom_quality (viewer) == GTH_ZOOM_QUALITY_LOW)
filter = CAIRO_FILTER_FAST;
else
filter = CAIRO_FILTER_BEST;
if (gth_image_viewer_get_zoom (viewer) == 1.0)
filter = CAIRO_FILTER_FAST;
gth_image_viewer_paint_region (viewer,
cr,
gth_image_viewer_get_current_image (viewer),
......@@ -180,7 +171,7 @@ gth_image_dragger_expose (GthImageViewerTool *self,
viewer->y_offset - viewer->image_area.y,
&viewer->image_area,
event->region,
filter);
gth_image_viewer_get_zoom_quality_filter (viewer));
gth_image_viewer_apply_painters (viewer, event, cr);
}
......
......@@ -609,7 +609,7 @@ paint_background (GthImageSelector *self,
self->priv->viewer->y_offset - self->priv->viewer->image_area.y,
&self->priv->viewer->image_area,
event->region,
CAIRO_FILTER_GOOD);
gth_image_viewer_get_zoom_quality_filter (self->priv->viewer));
/* make the background darker */
{
......@@ -653,7 +653,7 @@ paint_selection (GthImageSelector *self,
self->priv->viewer->y_offset - self->priv->viewer->image_area.y,
&selection_area,
event->region,
CAIRO_FILTER_GOOD);
gth_image_viewer_get_zoom_quality_filter (self->priv->viewer));
cairo_save (cr);
......@@ -695,7 +695,7 @@ paint_image (GthImageSelector *self,
self->priv->viewer->y_offset - self->priv->viewer->image_area.y,
&self->priv->viewer->image_area,
event->region,
CAIRO_FILTER_GOOD);
gth_image_viewer_get_zoom_quality_filter (self->priv->viewer));
}
......
......@@ -2030,6 +2030,23 @@ gth_image_viewer_get_zoom_quality (GthImageViewer *self)
}
cairo_filter_t
gth_image_viewer_get_zoom_quality_filter (GthImageViewer *viewer)
{
cairo_filter_t filter;
if (gth_image_viewer_get_zoom_quality (viewer) == GTH_ZOOM_QUALITY_LOW)
filter = CAIRO_FILTER_FAST;
else
filter = CAIRO_FILTER_BEST;
if (gth_image_viewer_get_zoom (viewer) == 1.0)
filter = CAIRO_FILTER_FAST;
return filter;
}
void
gth_image_viewer_set_zoom_change (GthImageViewer *self,
GthZoomChange zoom_change)
......
......@@ -217,6 +217,7 @@ gdouble gth_image_viewer_get_zoom (GthImageViewer *vi
void gth_image_viewer_set_zoom_quality (GthImageViewer *viewer,
GthZoomQuality quality);
GthZoomQuality gth_image_viewer_get_zoom_quality (GthImageViewer *viewer);
cairo_filter_t gth_image_viewer_get_zoom_quality_filter (GthImageViewer *viewer);
void gth_image_viewer_set_zoom_change (GthImageViewer *viewer,
GthZoomChange zoom_change);
GthZoomChange gth_image_viewer_get_zoom_change (GthImageViewer *viewer);
......
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