Commit c5c74fe46d93d26c7aa71a5019b2f4a6fc0505ae
1 parent
37ebb647
Updates following FrameCallback changes
Change-Id: I6f7e6fe49e640f828fa7aa288560477a1cd9157c
Showing
1 changed file
with
19 additions
and
17 deletions
examples/frame-callback/frame-callback.cpp
| ... | ... | @@ -18,8 +18,6 @@ |
| 18 | 18 | // CLASS HEADER |
| 19 | 19 | #include "frame-callback.h" |
| 20 | 20 | |
| 21 | -#include <iostream> | |
| 22 | - | |
| 23 | 21 | using namespace Dali; |
| 24 | 22 | |
| 25 | 23 | FrameCallback::FrameCallback() |
| ... | ... | @@ -45,23 +43,27 @@ void FrameCallback::Update( Dali::UpdateProxy& updateProxy, float /* elapsedSeco |
| 45 | 43 | { |
| 46 | 44 | Vector3 position; |
| 47 | 45 | Vector3 size; |
| 48 | - updateProxy.GetPositionAndSize( i, position, size ); // Retrieve the position and size using the Actor ID. | |
| 49 | - | |
| 50 | - float halfWidthPoint = stageHalfWidth - size.width * 0.5f; | |
| 51 | - float xTranslation = std::abs( position.x ); | |
| 52 | - if( xTranslation > halfWidthPoint ) | |
| 46 | + if( updateProxy.GetPositionAndSize( i, position, size ) ) // Retrieve the position and size using the Actor ID. | |
| 53 | 47 | { |
| 54 | - // Actor has hit the edge, adjust the size accordingly. | |
| 55 | - float adjustment = xTranslation - halfWidthPoint; | |
| 56 | - size.width += adjustment * SIZE_MULTIPLIER; | |
| 57 | - size.height += adjustment * SIZE_MULTIPLIER; | |
| 48 | + float halfWidthPoint = stageHalfWidth - size.width * 0.5f; | |
| 49 | + float xTranslation = std::abs( position.x ); | |
| 50 | + if( xTranslation > halfWidthPoint ) | |
| 51 | + { | |
| 52 | + // Actor has hit the edge, adjust the size accordingly. | |
| 53 | + float adjustment = xTranslation - halfWidthPoint; | |
| 54 | + size.width += adjustment * SIZE_MULTIPLIER; | |
| 55 | + size.height += adjustment * SIZE_MULTIPLIER; | |
| 58 | 56 | |
| 59 | - updateProxy.SetSize( i, size ); // Set the size using the UpdateProxy. | |
| 60 | - } | |
| 57 | + updateProxy.SetSize( i, size ); // Set the size using the UpdateProxy. | |
| 58 | + } | |
| 61 | 59 | |
| 62 | - // Retrieve the actor's position and set make it more transparent the closer it is to the middle. | |
| 63 | - Vector4 color = updateProxy.GetWorldColor( i ); | |
| 64 | - color.a = xTranslation / halfWidthPoint; | |
| 65 | - updateProxy.SetWorldColor( i, color ); | |
| 60 | + // Retrieve the actor's position and set make it more transparent the closer it is to the middle. | |
| 61 | + Vector4 color; | |
| 62 | + if( updateProxy.GetColor( i, color ) ) | |
| 63 | + { | |
| 64 | + color.a = xTranslation / halfWidthPoint; | |
| 65 | + updateProxy.SetColor( i, color ); | |
| 66 | + } | |
| 67 | + } | |
| 66 | 68 | } |
| 67 | 69 | } | ... | ... |