summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDonald Stewart <watersnowrock@gmail.com>2017-05-07 10:07:00 +0200
committerRĂ©mi Verschelde <rverschelde@gmail.com>2017-05-07 10:07:00 +0200
commit35953190930d36d76c87f6ba92390d37db0afdb3 (patch)
tree600e074afb35ab99117de7acb150b0b7f0bbe2bb /common
parent186fd5746a6fe43e06e4663df025497af343fad9 (diff)
downloadtheme-35953190930d36d76c87f6ba92390d37db0afdb3.tar
theme-35953190930d36d76c87f6ba92390d37db0afdb3.tar.gz
theme-35953190930d36d76c87f6ba92390d37db0afdb3.tar.bz2
theme-35953190930d36d76c87f6ba92390d37db0afdb3.tar.xz
theme-35953190930d36d76c87f6ba92390d37db0afdb3.zip
Plymouth: Improve scaling and aspect ratio handling
Hopefully fixes mga#19860.
Diffstat (limited to 'common')
-rw-r--r--common/plymouth/mga.script36
1 files changed, 20 insertions, 16 deletions
diff --git a/common/plymouth/mga.script b/common/plymouth/mga.script
index f373d9b..92311dc 100644
--- a/common/plymouth/mga.script
+++ b/common/plymouth/mga.script
@@ -23,8 +23,6 @@ Window.GetMaxHeight = fun (){
};
-
-
if (Plymouth.GetMode() == "suspend" || Plymouth.GetMode() == "resume") {
background.original_image = ImageNew("suspend.png");
Window.SetBackgroundTopColor(1, 0, 0);
@@ -50,47 +48,53 @@ else {
}
}
-scaleheight = Window.GetHeight() / logo.original_image.GetHeight();
-logo.image = logo.original_image.Scale(logo.original_image.GetWidth() * scaleheight, logo.original_image.GetHeight() * scaleheight);
+logo.image = logo.original_image.Scale(logo.original_image.GetWidth() , logo.original_image.GetHeight() );
logo.sprite = SpriteNew();
logo.sprite.SetImage(logo.image);
-offset = Window.GetWidth() / 2 - logo.sprite.GetImage().GetWidth() / 2 ;
-logo.sprite.SetX (offset );
+offsetx = Window.GetWidth() / 4 - 30 ;
+offsety = Window.GetHeight() / 2 - logo.sprite.GetImage().GetHeight() / 2 ;
+logo.sprite.SetX (offsetx ); #as bubble and logo image are same size, can be used throughout
+logo.sprite.SetY (offsety );
logo.opacity_angle = 0;
progressbar2.original_image = ImageNew("bubble1.png");
-progressbar2.image = progressbar2.original_image.Scale(progressbar2.original_image.GetWidth() * scaleheight, progressbar2.original_image.GetHeight() * scaleheight);
+progressbar2.image = progressbar2.original_image.Scale(progressbar2.original_image.GetWidth() , progressbar2.original_image.GetHeight() );
progressbar2.sprite = SpriteNew();
progressbar2.sprite.SetImage(progressbar2.image);
-progressbar2.sprite.SetX(offset );
+progressbar2.sprite.SetX(offsetx );
+progressbar2.sprite.SetY(offsety );
progressbar2.opacity_angle = 0;
progressbar3.original_image = ImageNew("bubble2.png");
-progressbar3.image = progressbar3.original_image.Scale(progressbar3.original_image.GetWidth() * scaleheight, progressbar3.original_image.GetHeight() * scaleheight);
+progressbar3.image = progressbar3.original_image.Scale(progressbar3.original_image.GetWidth() , progressbar3.original_image.GetHeight() );
progressbar3.sprite = SpriteNew();
progressbar3.sprite.SetImage(progressbar3.image);
-progressbar3.sprite.SetX(offset );
+progressbar3.sprite.SetX(offsetx );
+progressbar3.sprite.SetY(offsety );
progressbar3.opacity_angle = 0;
progressbar4.original_image = ImageNew("bubble3.png");
-progressbar4.image = progressbar4.original_image.Scale(progressbar4.original_image.GetWidth() * scaleheight, progressbar4.original_image.GetHeight() * scaleheight);
+progressbar4.image = progressbar4.original_image.Scale(progressbar4.original_image.GetWidth() , progressbar4.original_image.GetHeight() );
progressbar4.sprite = SpriteNew();
progressbar4.sprite.SetImage(progressbar4.image);
-progressbar4.sprite.SetX(offset );
+progressbar4.sprite.SetX(offsetx );
+progressbar4.sprite.SetY(offsety );
progressbar4.opacity_angle = 0;
progressbar5.original_image = ImageNew("bubble4.png");
-progressbar5.image = progressbar5.original_image.Scale(progressbar5.original_image.GetWidth() * scaleheight, progressbar5.original_image.GetHeight() * scaleheight);
+progressbar5.image = progressbar5.original_image.Scale(progressbar5.original_image.GetWidth() , progressbar5.original_image.GetHeight() );
progressbar5.sprite = SpriteNew();
progressbar5.sprite.SetImage(progressbar5.image);
-progressbar5.sprite.SetX(offset );
+progressbar5.sprite.SetX(offsetx );
+progressbar5.sprite.SetY(offsety );
progressbar5.opacity_angle = 0;
progressbar6.original_image = ImageNew("bubble5.png");
-progressbar6.image = progressbar6.original_image.Scale(progressbar6.original_image.GetWidth() * scaleheight, progressbar6.original_image.GetHeight() * scaleheight);
+progressbar6.image = progressbar6.original_image.Scale(progressbar6.original_image.GetWidth() , progressbar6.original_image.GetHeight() );
progressbar6.sprite = SpriteNew();
progressbar6.sprite.SetImage(progressbar6.image);
-progressbar6.sprite.SetX(offset );
+progressbar6.sprite.SetX(offsetx );
+progressbar6.sprite.SetY(offsety );
progressbar6.opacity_angle = 0;
if (Plymouth.GetMode() == "shutdown") {