@@ -497,7 +497,6 @@ static void dialog_scaled_preview_check_resize(GtkWidget * preview_scaled, gint
497497void pixel_art_scalers_run (GimpDrawable * drawable , GimpPreview * preview )
498498{
499499 GimpPixelRgn src_rgn ;
500- gint x , y ;
501500 gint original_bpp ;
502501 guint scale_factor ;
503502 image_info source_image ;
@@ -511,19 +510,20 @@ void pixel_art_scalers_run(GimpDrawable *drawable, GimpPreview *preview)
511510
512511 // Get the working image area for either the preview sub-window or the entire image
513512 if (preview ) {
514- gimp_preview_get_position (preview , & x , & y );
513+ gimp_preview_get_position (preview , & source_image . x , & source_image . y );
515514 gimp_preview_get_size (preview , & source_image .width , & source_image .height );
516515 }
517516 else if (! gimp_drawable_mask_intersect (drawable -> drawable_id ,
518- & x , & y , & source_image .width , & source_image .height )) {
517+ & source_image .x , & source_image .y ,
518+ & source_image .width , & source_image .height )) {
519519 return ;
520520 }
521521
522522 // Get bit depth and alpha mask status
523523 source_image .bpp = drawable -> bpp ;
524524 original_bpp = source_image .bpp ;
525525
526- if (scaled_output_check_reapply_scalers (scaler_mode_get (), x , y )) {
526+ if (scaled_output_check_reapply_scalers (scaler_mode_get (), source_image )) {
527527
528528 // ====== GET THE SOURCE IMAGE ======
529529
@@ -536,14 +536,15 @@ void pixel_art_scalers_run(GimpDrawable *drawable, GimpPreview *preview)
536536 // Initialize source pixel region with drawable
537537 gimp_pixel_rgn_init (& src_rgn ,
538538 drawable ,
539- x , y ,
539+ source_image . x , source_image . y ,
540540 source_image .width , source_image .height ,
541541 FALSE, FALSE);
542542
543543 // Copy source image to working buffer
544544 gimp_pixel_rgn_get_rect (& src_rgn ,
545545 (guchar * ) source_image .p_imagebuf ,
546- x , y , source_image .width , source_image .height );
546+ source_image .x , source_image .y ,
547+ source_image .width , source_image .height );
547548
548549 // Add alpha channel byte to source buffer if needed (scalers expect 4BPP RGBA)
549550 if (source_image .bpp == BYTE_SIZE_RGB_3BPP ) { // i.e. !has_alpha
@@ -582,7 +583,7 @@ void pixel_art_scalers_run(GimpDrawable *drawable, GimpPreview *preview)
582583 // ====== APPLY THE SCALER ======
583584
584585 // Allocate output buffer for upscaled image
585- scaled_output_check_reallocate (scale_factor , source_image . width , source_image . height );
586+ scaled_output_check_reallocate (scale_factor , source_image );
586587
587588 // Expects 4BPP RGBA in source_image.p_imagebuf, outputs same to scaled_output->p_imagebuf
588589 scaler_apply (scaler_mode_get (),
0 commit comments