Commit 1f137406 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

don't call gimp_display_shell_scale() if the display isn't completely

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

	* app/display/gimpdisplayshell.c (gimp_display_shell_set_property):
	don't call gimp_display_shell_scale() if the display isn't
	completely setup yet.

	* app/display/gimpdisplayshell-scale.c (gimp_display_shell_scale):
	hack around to find out whether we should pass the pointer location
	or the center of the display to gimp_display_shell_scale_to().
parent 6d471b92
2005-04-14 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell.c (gimp_display_shell_set_property):
don't call gimp_display_shell_scale() if the display isn't
completely setup yet.
* app/display/gimpdisplayshell-scale.c (gimp_display_shell_scale):
hack around to find out whether we should pass the pointer location
or the center of the display to gimp_display_shell_scale_to().
2005-04-14 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-scale.c (gimp_display_shell_scale):
......
......@@ -359,23 +359,30 @@ gimp_display_shell_scale_set_dot_for_dot (GimpDisplayShell *shell,
* @zoom_type: whether to zoom in, our or to a specific scale
* @scale: ignored unless @zoom_type == %GIMP_ZOOM_TO
*
* This function calls gimp_display_shell_scale_to() using the
* position of the mouse pointer as coordinates.
* This function calls gimp_display_shell_scale_to(). It tries to be
* smart whether to use the position of the mouse pointer or the
* center of the display as coordinates.+
**/
void
gimp_display_shell_scale (GimpDisplayShell *shell,
GimpZoomType zoom_type,
gdouble new_scale)
{
gint x, y;
GdkEvent *event;
gint x, y;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (shell->canvas != NULL);
x = shell->disp_width / 2;
y = shell->disp_height / 2;
if (shell->canvas)
gtk_widget_get_pointer (GTK_WIDGET (shell->canvas), &x, &y);
event = gtk_get_current_event ();
if (! event || gtk_get_event_widget (event) == GTK_WIDGET (shell))
{
gtk_widget_get_pointer (shell->canvas, &x, &y);
}
gimp_display_shell_scale_to (shell, zoom_type, new_scale, x, y);
}
......
......@@ -431,8 +431,11 @@ gimp_display_shell_set_property (GObject *object,
switch (property_id)
{
case PROP_SCALE:
gimp_display_shell_scale (shell,
GIMP_ZOOM_TO, g_value_get_double (value));
if (shell->canvas)
gimp_display_shell_scale (shell,
GIMP_ZOOM_TO, g_value_get_double (value));
else
shell->scale = g_value_get_double (value);
break;
case PROP_UNIT:
gimp_display_shell_set_unit (shell, g_value_get_int (value));
......
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