namespace
{
bool gTouchCallBackCalled=false;
-bool gTouchCallBack2Called=false;
bool gHoverCallBackCalled=false;
/**
app.Render(1);
gTouchCallBackCalled = false;
- gTouchCallBack2Called = false;
// simulate a touch event
Dali::TouchPoint point( 0, TouchPoint::Down, 25.0f, 25.0f );
END_TEST;
}
-static bool TestCallback2(Actor actor, const TouchEvent& event)
-{
- gTouchCallBack2Called = true;
- return false;
- END_TEST;
-}
-
static bool TestCallback3(Actor actor, const HoverEvent& event)
{
gHoverCallBackCalled = true;
END_TEST;
}
-
-int UtcDaliActorSetDrawModeOverlayHitTest(void)
-{
- TestApplication app;
- tet_infoline(" UtcDaliActorSetDrawModeOverlayHitTest");
-
- BufferImage imageA = BufferImage::New(16, 16);
- BufferImage imageB = BufferImage::New(16, 16);
- ImageActor a = ImageActor::New( imageA );
- ImageActor b = ImageActor::New( imageB );
-
- // Render a,b as regular non-overlays. so order will be:
- Stage::GetCurrent().Add(a);
- Stage::GetCurrent().Add(b);
-
- a.SetSize( 100.0f, 100.0f );
- b.SetSize( 100.0f, 100.0f );
-
- // position b overlapping a. (regular non-overlays)
- // hit test at point 'x'
- // --------
- // | |
- // | a |
- // | --------
- // | |x |
- // | | |
- // ----| |
- // | b |
- // | |
- // --------
- // note: b is on top, because it's Z position is higher.
- a.SetPosition(Vector3(0.0f, 0.0f, 0.0f));
- b.SetPosition(Vector3(50.0f, 50.0f, 1.0f));
-
- // connect to their touch signals
- a.TouchedSignal().Connect(TestCallback);
- b.TouchedSignal().Connect(TestCallback2);
-
- a.SetDrawMode( DrawMode::NORMAL );
- b.SetDrawMode( DrawMode::NORMAL );
- SimulateTouchForSetOverlayHitTest(app);
-
- DALI_TEST_CHECK( gTouchCallBackCalled == false );
- DALI_TEST_CHECK( gTouchCallBack2Called == true );
- // Make Actor a an overlay.
- // --------
- // | |
- // | a |
- // | |----
- // | x | |
- // | | |
- // -------- |
- // | b |
- // | |
- // --------
- // note: a is on top, because it is an overlay.
- a.SetDrawMode( DrawMode::OVERLAY );
- b.SetDrawMode( DrawMode::NORMAL );
- SimulateTouchForSetOverlayHitTest(app);
-
- DALI_TEST_CHECK( gTouchCallBackCalled == true );
- DALI_TEST_CHECK( gTouchCallBack2Called == false );
- // Make both Actors as overlays
- // --------
- // | |
- // | a |
- // | --------
- // | |x |
- // | | |
- // ----| |
- // | b |
- // | |
- // --------
- // note: b is on top, because it is the 2nd child in the hierarchy.
- a.SetDrawMode( DrawMode::OVERLAY );
- b.SetDrawMode( DrawMode::OVERLAY );
- SimulateTouchForSetOverlayHitTest(app);
-
- DALI_TEST_CHECK( gTouchCallBackCalled == false );
- DALI_TEST_CHECK( gTouchCallBack2Called == true );
- END_TEST;
-}
-
int UtcDaliActorGetCurrentWorldMatrix(void)
{
TestApplication app;
Actor actor = Actor::New();
// Defaults
- DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_RESIZE_POLICY ).Get< std::string >(), "FIXED", TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_RESIZE_POLICY ).Get< std::string >(), "FIXED", TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_RESIZE_POLICY ).Get< std::string >(), "USE_NATURAL_SIZE", TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_RESIZE_POLICY ).Get< std::string >(), "USE_NATURAL_SIZE", TEST_LOCATION );
// Set resize policy for all dimensions
actor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
Actor actor = Actor::New();
- DALI_TEST_EQUALS( actor.GetHeightForWidth( 1.0f ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetHeightForWidth( 1.0f ), 1.0f, TEST_LOCATION );
END_TEST;
}
Actor actor = Actor::New();
- DALI_TEST_EQUALS( actor.GetWidthForHeight( 1.0f ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetWidthForHeight( 1.0f ), 1.0f, TEST_LOCATION );
END_TEST;
}