Update of /cvsroot/ufraw/ufraw In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27591
Modified Files: ufraw_preview.c Log Message: Do not render junk on screen during rotation. Index: ufraw_preview.c =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufraw_preview.c,v retrieving revision 1.308 retrieving revision 1.309 diff -u -d -r1.308 -r1.309 --- ufraw_preview.c 21 Nov 2009 05:51:59 -0000 1.308 +++ ufraw_preview.c 21 Nov 2009 22:41:41 -0000 1.309 @@ -1721,8 +1721,9 @@ return TRUE; } -static void update_crop_ranges(preview_data *data); -static void fix_crop_aspect(preview_data *data, CursorType cursor); +static void update_crop_ranges(preview_data *data, gboolean render); +static void fix_crop_aspect(preview_data *data, CursorType cursor, + gboolean render); static void set_new_aspect(preview_data *data); static void refresh_aspect(preview_data *data); @@ -1805,9 +1806,7 @@ CFG->CropY2 += d; } if ( data->CropMotionType!=crop_cursor ) { - fix_crop_aspect(data, data->CropMotionType); - update_crop_ranges(data); - if (!CFG->LockAspect) refresh_aspect(data); + fix_crop_aspect(data, data->CropMotionType, TRUE); } } @@ -1884,7 +1883,7 @@ data->FreezeDialog--; } -static void update_crop_ranges(preview_data *data) +static void update_crop_ranges(preview_data *data, gboolean render) { if (data->FreezeDialog) return; @@ -1941,6 +1940,9 @@ data->DrawnCropY2 = CropY2; i++; } + update_shrink_ranges(data); + if (!render) + return; // It is better not to draw lines than to draw partial lines: int saveDrawLines = CFG->drawLines; CFG->drawLines = 0; @@ -1961,7 +1963,6 @@ data->DrawCropID = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE+30, (GSourceFunc)(preview_draw_crop), data, NULL); } - update_shrink_ranges(data); g_idle_add_full(G_PRIORITY_DEFAULT_IDLE+20, (GSourceFunc)(render_live_histogram), data, NULL); } @@ -2148,7 +2149,7 @@ * We only need to draw the flipped image. */ preview_draw_all(data); } - update_crop_ranges(data); + update_crop_ranges(data, TRUE); refresh_aspect(data); } @@ -2198,7 +2199,8 @@ g_free(text); } -static void fix_crop_aspect(preview_data *data, CursorType cursor) +static void fix_crop_aspect(preview_data *data, CursorType cursor, + gboolean render) { double aspect; @@ -2326,8 +2328,9 @@ default: return; } - - update_crop_ranges(data); + update_crop_ranges(data, render); + if (!CFG->LockAspect) + refresh_aspect(data); } /* Modify current crop area so that it fits current aspect ratio */ @@ -2374,7 +2377,7 @@ CFG->CropY1 = floor(cy - dy + 0.5); CFG->CropY2 = floor(cy + dy + 0.5); - update_crop_ranges(data); + update_crop_ranges(data, TRUE); } static void lock_aspect(GtkWidget *widget) @@ -2904,9 +2907,7 @@ if ( (int *)valuep==&CFG->CropX2) cursor = right_cursor; if ( (int *)valuep==&CFG->CropY1) cursor = top_cursor; if ( (int *)valuep==&CFG->CropY2) cursor = bottom_cursor; - fix_crop_aspect(data, cursor); - update_crop_ranges(data); - if (!CFG->LockAspect) refresh_aspect(data); + fix_crop_aspect(data, cursor, TRUE); return; } /* Do nothing if value didn't really change */ @@ -3067,20 +3068,13 @@ } ufraw_invalidate_layer(data->UF, ufraw_transform_phase); - /* render_init() will resize the pixbuf when it detects that the future - * final image will get a different size. This is required for - * fix_crop_aspect() and update_crop_ranges() because they attempt to draw. - * Unfortunately the image is not yet there, causing some crap to appear - * during a short time (try rotate -90 followed by -9). */ - /* TODO: fix the above. */ render_init(data); if (CFG->CropX2 > data->UF->rotatedWidth) - fix_crop_aspect(data, top_right_cursor); + fix_crop_aspect(data, top_right_cursor, FALSE); else if (CFG->CropY2 > data->UF->rotatedHeight) - fix_crop_aspect(data, bottom_left_cursor); - update_crop_ranges(data); - if (!CFG->LockAspect) - refresh_aspect(data); + fix_crop_aspect(data, bottom_left_cursor, FALSE); + else + update_crop_ranges(data, FALSE); update_scales(data); } @@ -5779,7 +5773,7 @@ data->FreezeDialog = FALSE; data->RenderMode = render_default; - update_crop_ranges(data); + update_crop_ranges(data, FALSE); update_scales(data); data->OverUnderTicker = 0; ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ ufraw-cvs mailing list ufraw-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ufraw-cvs