Fixups for change in gradient USER_SPACE basis 20/324420/2
authorDavid Steele <david.steele@samsung.com>
Fri, 16 May 2025 13:22:06 +0000 (14:22 +0100)
committerDavid Steele <david.steele@samsung.com>
Fri, 16 May 2025 14:33:33 +0000 (15:33 +0100)
Change-Id: I7e9fbea30ce5d0adc682052e5be02c573844afb1

17 files changed:
examples/animated-shapes/animated-shapes-example.cpp
examples/builder/examples.cpp
examples/gradients/gradients-example.cpp
examples/renderer-stencil/renderer-stencil-example.cpp
examples/scene3d/scene3d-example.cpp
resources/style/android/demo-theme.json
resources/style/android/examples-theme.json
resources/style/android/tests-theme.json
resources/style/demo-theme.json
resources/style/examples-theme.json
resources/style/mobile/demo-theme.json
resources/style/mobile/examples-theme.json
resources/style/mobile/tests-theme.json
resources/style/rpi/demo-theme.json
resources/style/rpi/examples-theme.json
resources/style/rpi/tests-theme.json
resources/style/tests-theme.json

index 204fcef3248d30e86955fb9d99dec866a3412e16..6fecf6d1448308e692f440bce25ed1de3387e6a0 100644 (file)
@@ -90,9 +90,8 @@ public:
     stopColors.PushBack(Vector4(0.0f, 0.0f, 1.0f, 1.0f));
     stopColors.PushBack(Vector4(1.0f, 1.0f, 1.0f, 1.0f));
     map.Insert(GradientVisual::Property::STOP_COLOR, stopColors);
-    Vector2 halfWindowSize = windowSize * 0.5f;
-    map.Insert(GradientVisual::Property::START_POSITION, Vector2(0.0f, -halfWindowSize.y));
-    map.Insert(GradientVisual::Property::END_POSITION, Vector2(0.0f, halfWindowSize.y));
+    map.Insert(GradientVisual::Property::START_POSITION, Vector2::ZERO);
+    map.Insert(GradientVisual::Property::END_POSITION, Vector2(0.0f, windowSize.y));
     map.Insert(GradientVisual::Property::UNITS, GradientVisual::Units::USER_SPACE);
     background[Dali::Toolkit::Control::Property::BACKGROUND] = map;
     window.Add(background);
index 1e91d292a53e285d626fb127413fb527902c5ff8..b5d7c16a1e04ee3e02e2c316d0377a75d16de6eb 100644 (file)
@@ -492,7 +492,13 @@ public:
     stopColors.PushBack(Vector4(0.45f, 0.70f, 0.80f, 1.0f)); // Medium bright, pastel blue
     const float percentageWindowHeight = window.GetSize().GetHeight() * 0.6f;
 
-    mNavigationView.SetProperty(Toolkit::Control::Property::BACKGROUND, Dali::Property::Map().Add(Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::GRADIENT).Add(Toolkit::GradientVisual::Property::STOP_OFFSET, stopOffsets).Add(Toolkit::GradientVisual::Property::STOP_COLOR, stopColors).Add(Toolkit::GradientVisual::Property::START_POSITION, Vector2(0.0f, -percentageWindowHeight)).Add(Toolkit::GradientVisual::Property::END_POSITION, Vector2(0.0f, percentageWindowHeight)).Add(Toolkit::GradientVisual::Property::UNITS, Toolkit::GradientVisual::Units::USER_SPACE));
+    Dali::Property::Map map{};
+    map.Add(Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::GRADIENT);
+    map.Add(Toolkit::GradientVisual::Property::STOP_OFFSET, stopOffsets);
+    map.Add(Toolkit::GradientVisual::Property::STOP_COLOR, stopColors);
+    map.Add(Toolkit::GradientVisual::Property::START_POSITION, Vector2(0.0f, -percentageWindowHeight*0.5f));
+    map.Add(Toolkit::GradientVisual::Property::END_POSITION, Vector2(0.0f, percentageWindowHeight*0.5f));
+    mNavigationView.SetProperty(Toolkit::Control::Property::BACKGROUND, map);
 
     SetUpItemView();
     mNavigationView.Push(mItemView);
index c82f0c4ca6e2148f0fd4e5e891e58cab3668c742..5cd675c6056c0db23bd92f61f9584513accb75e6 100644 (file)
@@ -166,9 +166,9 @@ public:
       }
       case 1: // linear gradient with units as userSpaceOnUse
       {
-        Vector2 halfWindowSize = Vector2(mApplication.GetWindow().GetSize()) * 0.5f;
-        gradientMap.Insert(GradientVisual::Property::START_POSITION, halfWindowSize);
-        gradientMap.Insert(GradientVisual::Property::END_POSITION, -halfWindowSize);
+        Vector2 windowSize = Vector2(mApplication.GetWindow().GetSize())*0.8f;
+        gradientMap.Insert(GradientVisual::Property::START_POSITION, Vector2::ZERO);
+        gradientMap.Insert(GradientVisual::Property::END_POSITION, windowSize);
         gradientMap.Insert(GradientVisual::Property::UNITS, GradientVisual::Units::USER_SPACE);
         break;
       }
@@ -181,8 +181,8 @@ public:
       default: // radial gradient with units as userSpaceOnUse
       {
         Vector2 windowSize = mApplication.GetWindow().GetSize();
-        gradientMap.Insert(GradientVisual::Property::CENTER, windowSize * 0.5f);
-        gradientMap.Insert(GradientVisual::Property::RADIUS, windowSize.Length());
+        gradientMap.Insert(GradientVisual::Property::CENTER, windowSize*0.8f);
+        gradientMap.Insert(GradientVisual::Property::RADIUS, windowSize.Length()*0.8f);
         gradientMap.Insert(GradientVisual::Property::UNITS, GradientVisual::Units::USER_SPACE);
         break;
       }
index d48e6aa4e8123fdfeb167fba338e860a5ae3d801..8f9c6cc21b1c8c20a7acd644170dcec45c856ae8 100644 (file)
@@ -137,9 +137,15 @@ private:
     Property::Array stopColors;
     stopColors.PushBack(Vector4(0.17f, 0.24f, 0.35f, 1.0f)); // Dark, medium saturated blue  ( top   of screen)
     stopColors.PushBack(Vector4(0.45f, 0.70f, 0.80f, 1.0f)); // Medium bright, pastel blue   (bottom of screen)
-    const float percentageWindowHeight = window.GetSize().GetHeight() * 0.7f;
-
-    background.SetProperty(Toolkit::Control::Property::BACKGROUND, Dali::Property::Map().Add(Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::GRADIENT).Add(Toolkit::GradientVisual::Property::STOP_OFFSET, stopOffsets).Add(Toolkit::GradientVisual::Property::STOP_COLOR, stopColors).Add(Toolkit::GradientVisual::Property::START_POSITION, Vector2(0.0f, -percentageWindowHeight)).Add(Toolkit::GradientVisual::Property::END_POSITION, Vector2(0.0f, percentageWindowHeight)).Add(Toolkit::GradientVisual::Property::UNITS, Toolkit::GradientVisual::Units::USER_SPACE));
+    const float percentageWindowHeight = window.GetSize().GetHeight()*0.8f;
+
+    background.SetProperty(Toolkit::Control::Property::BACKGROUND, Dali::Property::Map()
+                           .Add(Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::GRADIENT)
+                           .Add(Toolkit::GradientVisual::Property::STOP_OFFSET, stopOffsets)
+                           .Add(Toolkit::GradientVisual::Property::STOP_COLOR, stopColors)
+                           .Add(Toolkit::GradientVisual::Property::START_POSITION, Vector2(0.0f, 0.0f))
+                           .Add(Toolkit::GradientVisual::Property::END_POSITION, Vector2(0.0f, percentageWindowHeight))
+                           .Add(Toolkit::GradientVisual::Property::UNITS, Toolkit::GradientVisual::Units::USER_SPACE));
 
     window.Add(background);
 
index b65172784eb8545c983097245a71a3cf3a9d5343..df2e67b4102c77e9d718ac34ab65ef8d57fa8c4d 100644 (file)
@@ -285,16 +285,16 @@ void Scene3DExample::OnInit(Application& app)
   Property::Array stopColors;\r
   stopColors.PushBack(Color::BLACK);\r
   stopColors.PushBack(Vector4(0.45f, 0.7f, 0.8f, 1.f)); // Medium bright, pastel blue\r
-  const float percentageWindowHeight = window.GetSize().GetHeight() * 0.6f;\r
+  const float percentageWindowHeight = window.GetSize().GetHeight() * 0.8f;\r
 \r
   navigationView.SetProperty(Toolkit::Control::Property::BACKGROUND,\r
                              Dali::Property::Map()\r
                                .Add(Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::GRADIENT)\r
                                .Add(Toolkit::GradientVisual::Property::STOP_OFFSET, stopOffsets)\r
                                .Add(Toolkit::GradientVisual::Property::STOP_COLOR, stopColors)\r
-                               .Add(Toolkit::GradientVisual::Property::START_POSITION, Vector2(0.f, -percentageWindowHeight))\r
-                               .Add(Toolkit::GradientVisual::Property::END_POSITION, Vector2(0.f, percentageWindowHeight))\r
-                               .Add(Toolkit::GradientVisual::Property::UNITS, Toolkit::GradientVisual::Units::USER_SPACE));\r
+                               .Add(Toolkit::GradientVisual::Property::START_POSITION, Vector2(0.f, 0.0f))\r
+                             .Add(Toolkit::GradientVisual::Property::END_POSITION, Vector2(0.f, percentageWindowHeight))\r
+                             .Add(Toolkit::GradientVisual::Property::UNITS, Toolkit::GradientVisual::Units::USER_SPACE));\r
   window.Add(navigationView);\r
   mNavigationView = navigationView;\r
 \r
index 335b0577f01108644cff62a2037989517b05f9c2..3f636431b5977641156b279b5309a756032250eb 100644 (file)
@@ -33,7 +33,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [240, 400],
+        "center": [480, 800],
         "radius": 932,
         "units": "USER_SPACE",
         "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
index bb30bc5bde64124276ee55435f5a90c57370c69a..92ddc9c39e43392534cd447f2744ca6476d5579b 100644 (file)
@@ -40,7 +40,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [240, 400],
+        "center": [480, 800],
         "radius": 932,
         "units": "USER_SPACE",
         "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]]
index 44db03e8457c7be28a728571c1f9f54905fb1faa..8132dddc2ff393ca56119890c040db98c343e54e 100644 (file)
@@ -39,7 +39,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [240, 400],
+        "center": [480, 800],
         "radius": 932,
         "units": "USER_SPACE",
         "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]]
index 1203c5230d6ef87604fbdfa87c0f93248b25ad6b..cc42da2b3e72fcaf56af257e7c6a7d63e42fbbab 100644 (file)
@@ -33,7 +33,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [240, 400],
+        "center": [480, 800],
         "radius": 932,
         "units": "USER_SPACE",
         "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
index 4dd7a862fa889d7115a0adb57a0a381d80af8942..a692fdf56fd37e962797217223186f904183921c 100644 (file)
@@ -40,7 +40,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [240, 400],
+        "center": [480, 800],
         "radius": 932,
         "units": "USER_SPACE",
         "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]]
index 05578b7e70de87089330d3204cd6c838ed1eab70..1817e521d84f74ffc8bcc5c40aac44f6fca26e42 100644 (file)
@@ -33,7 +33,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [360, 640],
+        "center": [720, 1280],
         "radius": 1468,
         "units": "USER_SPACE",
         "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
index f6e1c6b00f843144ca50f22a78b0ec753a07aaf7..f65ce327273335cfd706160d0f31caba42d14e34 100644 (file)
@@ -40,7 +40,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [360, 640],
+        "center": [720, 1280],
         "radius": 1468,
         "units": "USER_SPACE",
         "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]]
index 90d80492e31d6e748099d7637cd70649949c28d8..c5ba99feb45974f8b32712f60ec80a411e38ac04 100644 (file)
@@ -39,7 +39,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [360, 640],
+        "center": [720, 1280],
         "radius": 1468,
         "units": "USER_SPACE",
         "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]]
index 2405e72cf60c1f71e51e7209c346d6384c852301..83cca97f795112113db7cfe2f7150f6fcd120ce9 100644 (file)
@@ -33,7 +33,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [240, 400],
+        "center": [480, 800],
         "radius": 932,
         "units": "USER_SPACE",
         "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
index f6e1c6b00f843144ca50f22a78b0ec753a07aaf7..f65ce327273335cfd706160d0f31caba42d14e34 100644 (file)
@@ -40,7 +40,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [360, 640],
+        "center": [720, 1280],
         "radius": 1468,
         "units": "USER_SPACE",
         "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]]
index 90d80492e31d6e748099d7637cd70649949c28d8..c5ba99feb45974f8b32712f60ec80a411e38ac04 100644 (file)
@@ -39,7 +39,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [360, 640],
+        "center": [720, 1280],
         "radius": 1468,
         "units": "USER_SPACE",
         "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]]
index c25d961603560f4f5f2f5f9e60ea415c248a883b..ba2a05162e94dbd6205bb1ed2aacb5170366e8c1 100644 (file)
@@ -39,7 +39,7 @@
       "background":
       {
         "visualType": "GRADIENT",
-        "center": [240, 400],
+        "center": [480, 800],
         "radius": 932,
         "units": "USER_SPACE",
         "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]]