]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Add taper to the progress bar leading edge in the solar plugin.
authorCharles Brej <cbrej@cs.man.ac.uk>
Tue, 28 Oct 2008 11:01:08 +0000 (11:01 +0000)
committerCharles Brej <cbrej@cs.man.ac.uk>
Tue, 28 Oct 2008 11:01:08 +0000 (11:01 +0000)
src/plugins/splash/solar/plugin.c

index 976175e588f5204d2834d4fc64431938d6fc25ba..823d0d49e4b5583c41c726a89fa96648a2d1837b 100644 (file)
@@ -361,18 +361,31 @@ stretch_image(ply_image_t *scaled_image, ply_image_t *orig_image, int width)
   
   
   for (y=0; y<stretched_height; y++)
-  for (x=0; x<stretched_width;  x++)
-      if(x<width)
-        {
-          uint32_t value = 0x0;
-          int new_x = (x * orig_width) / width;
-          value = orig_image_data[new_x + y * orig_width];
-          scaled_image_data[x + y * stretched_width] = value;
-        }
-    else
+    {
+      float my_width = y+0.5;
+      my_width /= (stretched_height);
+      my_width *= 2;
+      my_width -= 1;
+      my_width *= my_width;
+      my_width = sqrt(1-my_width);
+      my_width *= stretched_height;
+      my_width /= 2;
+      my_width = width-stretched_height+my_width;
+      for (x=0; x<stretched_width;  x++)
         {
-          scaled_image_data[x + y * stretched_width] = 0;
+          if(x<my_width)
+            {
+              uint32_t value = 0x0;
+              int new_x = (x * orig_width) / width;
+              value = orig_image_data[new_x + y * orig_width];
+              scaled_image_data[x + y * stretched_width] = value;
+            }
+          else
+            {
+              scaled_image_data[x + y * stretched_width] = 0;
+            }
         }
+    }
 }
 
 static void