Re: centered background problems



Rolando Roman <landie@concentric.net> writes:

> i have the problem when trying to emboss
> 
> 
> On Sat, 12 Aug 2000, jack wallen wrote:
> > with the latest helix update if you try to center an image on the background -
> > no image will show up.  anyone see this bug?  anyone know of a fix?

I think these are two different things:

 - For embossing, the image needs to have strong contrasts - 
   like a black and white logo. Using a photograph will have
   almost no visible effect.

 - For centering, there was a bug in 1.2.1 if the image
   was bigger than the screen. The following patch (in
   CVS now) fixes.

Regards,
                                        Owen
   
--- control-center-1.2.1/capplets/background-properties/render-background.c.bigbg	Mon Aug  7 13:05:01 2000
+++ control-center-1.2.1/capplets/background-properties/render-background.c	Mon Aug  7 13:58:05 2000
@@ -131,7 +131,7 @@
     {
       if (j + y_offset >= 0 && j + y_offset < image_height)
 	{
-	  guchar *p = gdk_pixbuf_get_pixels (image) + (j + y_offset) * gdk_pixbuf_get_rowstride (image) + 3 * x_offset;
+	  guchar *p = gdk_pixbuf_get_pixels (image) + (j + y_offset) * gdk_pixbuf_get_rowstride (image) + 3 * (x_offset + 1);
       
 	  for (i=1; i<boss_width - 1; i++)
 	    {
@@ -295,9 +295,11 @@
 
 			xoff = (output_width - scaled_width) / 2;
 			yoff = (output_height - scaled_height) / 2;
-
+			
 			gdk_pixbuf_composite (image, result,
-					      xoff, yoff, scaled_width, scaled_height,
+					      MAX (xoff, 0), MAX (yoff, 0),
+					      MIN (xoff + scaled_width, output_width) - MAX (xoff, 0),
+					      MIN (yoff + scaled_height, output_height) - MAX (yoff, 0),
 					      xoff, yoff, (double)scaled_width/image_width, (double)scaled_height/image_height,
 					      GDK_INTERP_BILINEAR, 255);
 		}








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]