app: use projection and not image sizes

these are the same nearly always, but during
an image-scale, the image size is updated early
and expose redraw following dialog destruction
uses the projection before the scale.

Basically this patch partly restores the code
before commit 8b8e67ffe2
This commit is contained in:
Massimo Valentini
2011-12-11 17:11:25 +01:00
parent 5046f167fd
commit bea8b93959

View File

@ -85,9 +85,11 @@ gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell
gint *w, gint *w,
gint *h) gint *h)
{ {
GimpImage *image; GimpImage *image;
gdouble scale_x; GimpProjection *proj;
gdouble scale_y; TileManager *tiles;
gdouble scale_x;
gdouble scale_y;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
@ -95,10 +97,14 @@ gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell
g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_IMAGE (image));
proj = gimp_image_get_projection (image);
gimp_display_shell_calculate_scale_x_and_y (shell, scale, &scale_x, &scale_y); gimp_display_shell_calculate_scale_x_and_y (shell, scale, &scale_x, &scale_y);
if (w) *w = scale_x * gimp_image_get_width (image); tiles = gimp_projection_get_tiles_at_level (proj, 0, NULL);
if (h) *h = scale_y * gimp_image_get_height (image);
if (w) *w = scale_x * tile_manager_width (tiles);
if (h) *h = scale_y * tile_manager_height (tiles);
} }
void void