*-------------------------------------------------------------------
*/
+static void pixbuf_renderer_class_init_wrapper(void *g_class, void *class_data)
+{
+ pixbuf_renderer_class_init(g_class);
+}
+
+static void pixbuf_renderer_init_wrapper(PixbufRenderer *pr, void *class_data)
+{
+ pixbuf_renderer_init(pr);
+}
+
GType pixbuf_renderer_get_type(void)
{
static GType pixbuf_renderer_type = 0;
sizeof(PixbufRendererClass), /* class_size */
NULL, /* base_init */
NULL, /* base_finalize */
- (GClassInitFunc)pixbuf_renderer_class_init,
+ (GClassInitFunc)pixbuf_renderer_class_init_wrapper,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(PixbufRenderer), /* instance_size */
0, /* n_preallocs */
- (GInstanceInitFunc)pixbuf_renderer_init, /* instance_init */
+ (GInstanceInitFunc)pixbuf_renderer_init_wrapper, /* instance_init */
NULL, /* value_table */
};
"Zoom quality",
NULL,
GDK_INTERP_NEAREST,
- GDK_INTERP_HYPER,
+ GDK_INTERP_BILINEAR,
GDK_INTERP_BILINEAR,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property(gobject_class,
PROP_CACHE_SIZE_DISPLAY,
g_param_spec_uint("cache_display",
- "Display cache size MB",
+ "Display cache size MiB",
NULL,
0,
128,
static RendererFuncs *pr_backend_renderer_new(PixbufRenderer *pr)
{
- if (options->image.use_clutter_renderer)
+ if (options->image.use_clutter_renderer && !options->disable_gpu)
{
#ifdef HAVE_CLUTTER
return renderer_clutter_new(pr);
}
}
- if (increment < 0.0)
+ if (options->image.zoom_style == ZOOM_GEOMETRIC)
{
- if (zoom >= 1.0)
+ if (increment < 0.0)
{
- if (zoom / -(increment - 1.0) < 1.0)
+ if (zoom >= 1.0)
{
- zoom = 1.0 / (zoom / (increment - 1.0));
+ if (zoom / -(increment - 1.0) < 1.0)
+ {
+ zoom = 1.0 / (zoom / (increment - 1.0));
+ }
+ else
+ {
+ zoom = zoom / -(increment - 1.0) ;
+ }
}
else
{
- zoom = zoom / -(increment - 1.0) ;
+ zoom = zoom * -(increment - 1.0);
}
}
else
{
- zoom = zoom * -(increment - 1.0);
+ if (zoom <= -1.0 )
+ {
+ if (zoom / (increment + 1.0) > -1.0)
+ {
+ zoom = -(1.0 / (zoom / (increment + 1.0)));
+ }
+ else
+ {
+ zoom = zoom / (increment + 1.0) ;
+ }
+ }
+ else
+ {
+ zoom = zoom * (increment + 1.0);
+ }
}
}
else
{
- if (zoom <= -1.0 )
+ if (increment < 0.0)
{
- if (zoom / (increment + 1.0) > -1.0)
+ if (zoom >= 1.0 && zoom + increment < 1.0)
{
- zoom = -(1.0 / (zoom / (increment + 1.0)));
+ zoom = zoom + increment - 2.0;
}
else
{
- zoom = zoom / (increment + 1.0) ;
+ zoom = zoom + increment;
}
}
else
{
- zoom = zoom * (increment + 1.0);
+ if (zoom <= -1.0 && zoom + increment > -1.0)
+ {
+ zoom = zoom + increment + 2.0;
+ }
+ else
+ {
+ zoom = zoom + increment;
+ }
}
}
}
if (force) clamp_flags |= PR_ZOOM_INVALIDATE;
- (void) pr_parent_window_resize(pr, pr->width, pr->height);
if (!pr_zoom_clamp(pr, zoom, clamp_flags)) return;
(void) pr_size_clamp(pr);
+ (void) pr_parent_window_resize(pr, pr->width, pr->height);
if (force && new)
{
accel = 1;
}
- /* do the scroll */
- pixbuf_renderer_scroll(pr, (pr->drag_last_x - event->x) * accel,
- (pr->drag_last_y - event->y) * accel);
-
+ /* do the scroll - not when drawing rectangle*/
+ if (!options->draw_rectangle)
+ {
+ pixbuf_renderer_scroll(pr, (pr->drag_last_x - event->x) * accel,
+ (pr->drag_last_y - event->y) * accel);
+ }
pr_drag_signal(pr, event);
pr->drag_last_x = event->x;
{
pr_scroller_start(pr, bevent->x, bevent->y);
}
- else if (bevent->button == MOUSE_BUTTON_LEFT || bevent->button == MOUSE_BUTTON_MIDDLE || bevent->button == MOUSE_BUTTON_BACK || bevent->button == MOUSE_BUTTON_FORWARD)
+ else if (bevent->button == MOUSE_BUTTON_LEFT || bevent->button == MOUSE_BUTTON_MIDDLE)
{
pr_clicked_signal(pr, bevent);
}
x_pixel_clamped = CLAMP(x_pixel, 0, pr->image_width - 1);
y_pixel_clamped = CLAMP(y_pixel, 0, pr->image_height - 1);
- if(x_pixel != x_pixel_clamped || y_pixel != y_pixel_clamped)
+ if (x_pixel != x_pixel_clamped)
+ {
+ /* mouse is not on pr */
+ x_pixel = -1;
+ }
+ if (y_pixel != y_pixel_clamped)
{
/* mouse is not on pr */
- x_pixel = y_pixel = -1;
+ y_pixel = -1;
}
*x_pixel_return = x_pixel;
void pixbuf_renderer_set_size_early(PixbufRenderer *pr, guint width, guint height)
{
#if 0
- /* FIXME: this function does not consider the image orientation,
+ /** @FIXME this function does not consider the image orientation,
so it probably only breaks something */
gdouble zoom;
gint w, h;
#endif
}
+void pixbuf_renderer_set_ignore_alpha(PixbufRenderer *pr, gint ignore_alpha)
+{
+ g_return_if_fail(IS_PIXBUF_RENDERER(pr));
+
+ pr->ignore_alpha = ignore_alpha;
+ pr_pixbuf_size_sync(pr);
+ pr_zoom_sync(pr, pr->zoom, PR_ZOOM_FORCE, 0, 0);
+}
+
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */