diff --git a/ChangeLog b/ChangeLog index 91f48f0d1..e4b5143d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-07-07 Colin Watson + + * term/gfxterm.c (grub_gfxterm_background_image_cmd): Fix + indentation. + 2010-07-06 Colin Watson * conf/common.rmk (grub_probe_SOURCES): Add disk/raid5_recover.c diff --git a/term/gfxterm.c b/term/gfxterm.c index 44f6b191a..bf9705abd 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -1134,44 +1134,44 @@ grub_gfxterm_background_image_cmd (grub_extcmd_t cmd __attribute__ ((unused)), /* If filename was provided, try to load that. */ if (argc >= 1) { - /* Try to load new one. */ - grub_video_bitmap_load (&bitmap, args[0]); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; + /* Try to load new one. */ + grub_video_bitmap_load (&bitmap, args[0]); + if (grub_errno != GRUB_ERR_NONE) + return grub_errno; - /* Determine if the bitmap should be scaled to fit the screen. */ - if (!state[BACKGROUND_CMD_ARGINDEX_MODE].set - || grub_strcmp (state[BACKGROUND_CMD_ARGINDEX_MODE].arg, - "stretch") == 0) + /* Determine if the bitmap should be scaled to fit the screen. */ + if (!state[BACKGROUND_CMD_ARGINDEX_MODE].set + || grub_strcmp (state[BACKGROUND_CMD_ARGINDEX_MODE].arg, + "stretch") == 0) + { + if (window.width != grub_video_bitmap_get_width (bitmap) + || window.height != grub_video_bitmap_get_height (bitmap)) + { + struct grub_video_bitmap *scaled_bitmap; + grub_video_bitmap_create_scaled (&scaled_bitmap, + window.width, + window.height, + bitmap, + GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); + if (grub_errno == GRUB_ERR_NONE) + { + /* Replace the original bitmap with the scaled one. */ + grub_video_bitmap_destroy (bitmap); + bitmap = scaled_bitmap; + } + } + } + + /* If bitmap was loaded correctly, display it. */ + if (bitmap) { - if (window.width != grub_video_bitmap_get_width (bitmap) - || window.height != grub_video_bitmap_get_height (bitmap)) - { - struct grub_video_bitmap *scaled_bitmap; - grub_video_bitmap_create_scaled (&scaled_bitmap, - window.width, - window.height, - bitmap, - GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); - if (grub_errno == GRUB_ERR_NONE) - { - /* Replace the original bitmap with the scaled one. */ - grub_video_bitmap_destroy (bitmap); - bitmap = scaled_bitmap; - } - } + /* Determine bitmap dimensions. */ + bitmap_width = grub_video_bitmap_get_width (bitmap); + bitmap_height = grub_video_bitmap_get_height (bitmap); + + /* Mark whole screen as dirty. */ + dirty_region_add (0, 0, window.width, window.height); } - - /* If bitmap was loaded correctly, display it. */ - if (bitmap) - { - /* Determine bitmap dimensions. */ - bitmap_width = grub_video_bitmap_get_width (bitmap); - bitmap_height = grub_video_bitmap_get_height (bitmap); - - /* Mark whole screen as dirty. */ - dirty_region_add (0, 0, window.width, window.height); - } } /* All was ok. */