Commit e3d08ef7 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/display/gimpdisplayshell-callbacks.c when using Ctrl-wheel to zoom

2005-04-13  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-scale.[ch]: when using Ctrl-wheel
	to zoom in/out, center on the mouse position (bug #79384).
parent eb9374e5
2005-04-13 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-scale.[ch]: when using Ctrl-wheel
to zoom in/out, center on the mouse position (bug #79384).
2005-04-13 Adi Attar <aattar@cvs.gnome.org>
* configure.in: Added "xh" to ALL_LINGUAS.
......
......@@ -875,11 +875,13 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
switch (direction)
{
case GDK_SCROLL_UP:
gimp_display_shell_scale (shell, GIMP_ZOOM_IN, 0.0);
gimp_display_shell_scale_to (shell, GIMP_ZOOM_IN,
sevent->x, sevent->y);
break;
case GDK_SCROLL_DOWN:
gimp_display_shell_scale (shell, GIMP_ZOOM_OUT, 0.0);
gimp_display_shell_scale_to (shell, GIMP_ZOOM_OUT,
sevent->x, sevent->y);
break;
default:
......
......@@ -353,6 +353,41 @@ gimp_display_shell_scale_set_dot_for_dot (GimpDisplayShell *shell,
}
}
void
gimp_display_shell_scale_to (GimpDisplayShell *shell,
GimpZoomType zoom_type,
gdouble x,
gdouble y)
{
GimpDisplayConfig *config;
gdouble scale;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
scale = shell->scale;
if (! shell->gdisp)
return;
x += shell->offset_x;
y += shell->offset_y;
x /= scale;
y /= scale;
scale = gimp_display_shell_scale_zoom_step (zoom_type, scale);
x *= scale;
y *= scale;
config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config);
gimp_display_shell_scale_by_values (shell, scale,
x - (shell->disp_width / 2),
y - (shell->disp_height / 2),
config->resize_windows_on_zoom);
}
void
gimp_display_shell_scale (GimpDisplayShell *shell,
GimpZoomType zoom_type,
......
......@@ -34,6 +34,10 @@ void gimp_display_shell_scale_set_dot_for_dot (GimpDisplayShell *gdisp,
void gimp_display_shell_scale (GimpDisplayShell *gdisp,
GimpZoomType zoom_type,
gdouble new_scale);
void gimp_display_shell_scale_to (GimpDisplayShell *gdisp,
GimpZoomType zoom_type,
gdouble x,
gdouble y);
void gimp_display_shell_scale_fit_in (GimpDisplayShell *shell);
void gimp_display_shell_scale_fit_to (GimpDisplayShell *shell);
void gimp_display_shell_scale_by_values (GimpDisplayShell *gdisp,
......
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