Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ View CreateInteractiveView(TestApplication& application, float width = 100.0f, f
View view = View::New()
.SetRequestedWidth(width)
.SetRequestedHeight(height)
.SetPivotPoint(AnchorPoint::TOP_LEFT)
.SetPivot(Pivot::TOP_LEFT)
.SetParentOrigin(ParentOrigin::TOP_LEFT);

application.GetScene().Add(view);
Expand Down Expand Up @@ -606,7 +606,7 @@ int UtcDaliViewAsInteractiveWithLambdaP(void)
View view = View::New()
.SetRequestedWidth(100.0f)
.SetRequestedHeight(100.0f)
.SetPivotPoint(AnchorPoint::TOP_LEFT)
.SetPivot(Pivot::TOP_LEFT)
.SetParentOrigin(ParentOrigin::TOP_LEFT);

application.GetScene().Add(view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ InteractiveView CreateTestInteractiveView(TestApplication& application, float wi
InteractiveView view = InteractiveView::New();
view.SetRequestedWidth(width);
view.SetRequestedHeight(height);
view.SetPivotPoint(AnchorPoint::TOP_LEFT);
view.SetPivot(Pivot::TOP_LEFT);
view.SetParentOrigin(ParentOrigin::TOP_LEFT);

application.GetScene().Add(view);
Expand All @@ -220,7 +220,7 @@ InteractiveView CreateTestInteractiveViewFromImpl(TestApplication& application,

view.SetRequestedWidth(100.0f);
view.SetRequestedHeight(100.0f);
view.SetPivotPoint(AnchorPoint::TOP_LEFT);
view.SetPivot(Pivot::TOP_LEFT);
view.SetParentOrigin(ParentOrigin::TOP_LEFT);

application.GetScene().Add(view);
Expand Down Expand Up @@ -457,7 +457,7 @@ int UtcDaliInteractiveViewConnectClickedSignalP(void)
InteractiveView view = InteractiveView::New();
view.SetRequestedWidth(100.0f)
.SetRequestedHeight(100.0f)
.SetPivotPoint(AnchorPoint::TOP_LEFT)
.SetPivot(Pivot::TOP_LEFT)
.SetParentOrigin(ParentOrigin::TOP_LEFT)
.ConnectClickedSignal(&application, functor);

Expand Down Expand Up @@ -505,7 +505,7 @@ int UtcDaliInteractiveViewConnectPressedChangedSignalP(void)
InteractiveView view = InteractiveView::New();
view.SetRequestedWidth(100.0f)
.SetRequestedHeight(100.0f)
.SetPivotPoint(AnchorPoint::TOP_LEFT)
.SetPivot(Pivot::TOP_LEFT)
.SetParentOrigin(ParentOrigin::TOP_LEFT)
.ConnectPressedChangedSignal(&application, functor);

Expand Down Expand Up @@ -544,7 +544,7 @@ int UtcDaliInteractiveViewConnectLongPressedSignalP(void)
InteractiveView view = InteractiveView::New();
view.SetRequestedWidth(100.0f)
.SetRequestedHeight(100.0f)
.SetPivotPoint(AnchorPoint::TOP_LEFT)
.SetPivot(Pivot::TOP_LEFT)
.SetParentOrigin(ParentOrigin::TOP_LEFT)
.ConnectLongPressedSignal(&application, functor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ View CreateSelectableView(TestApplication& application, float width = 100.0f, fl
View view = View::New()
.SetRequestedWidth(width)
.SetRequestedHeight(height)
.SetPivotPoint(AnchorPoint::TOP_LEFT)
.SetPivot(Pivot::TOP_LEFT)
.SetParentOrigin(ParentOrigin::TOP_LEFT)
.AsSelectable();

Expand Down Expand Up @@ -384,7 +384,7 @@ int UtcDaliSelectableTraitToggleByClickP(void)
View view = View::New();
view.SetRequestedWidth(100.0f);
view.SetRequestedHeight(100.0f);
view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
view.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
application.GetScene().Add(view);

Expand Down Expand Up @@ -431,7 +431,7 @@ int UtcDaliSelectableTraitToggleByClickAutoCreatesInteractiveP(void)
View view = View::New();
view.SetRequestedWidth(100.0f);
view.SetRequestedHeight(100.0f);
view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
view.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
application.GetScene().Add(view);

Expand All @@ -457,7 +457,7 @@ int UtcDaliSelectableTraitToggleByClickWithExistingInteractiveP(void)
View view = View::New();
view.SetRequestedWidth(100.0f);
view.SetRequestedHeight(100.0f);
view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
view.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
application.GetScene().Add(view);

Expand Down Expand Up @@ -490,7 +490,7 @@ int UtcDaliSelectableTraitToggleByClickDoesNotConsumeClickP(void)
View view = View::New();
view.SetRequestedWidth(100.0f);
view.SetRequestedHeight(100.0f);
view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
view.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
application.GetScene().Add(view);

Expand Down Expand Up @@ -529,7 +529,7 @@ int UtcDaliSelectableTraitToggleByKeyP(void)
View view = View::New();
view.SetRequestedWidth(100.0f);
view.SetRequestedHeight(100.0f);
view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
view.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
application.GetScene().Add(view);

Expand Down Expand Up @@ -571,7 +571,7 @@ int UtcDaliSelectableTraitEnableToggleByClickAfterAttachP(void)
View view = View::New();
view.SetRequestedWidth(100.0f);
view.SetRequestedHeight(100.0f);
view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
view.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
application.GetScene().Add(view);

Expand Down Expand Up @@ -604,7 +604,7 @@ int UtcDaliSelectableTraitDisableToggleByClickP(void)
View view = View::New();
view.SetRequestedWidth(100.0f);
view.SetRequestedHeight(100.0f);
view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
view.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
application.GetScene().Add(view);

Expand Down
26 changes: 13 additions & 13 deletions automated-tests/src/dali-ui-foundation/utc-Dali-View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,32 +408,32 @@ int UtcDaliViewSetParentOriginP(void)
END_TEST;
}

int UtcDaliViewGetPivotPointP(void)
int UtcDaliViewGetPivotP(void)
{
UiTestApplication application;
View view = View::New();

Vector3 pivotPoint = view.GetPivotPoint();
DALI_TEST_EQUALS(pivotPoint.x, 0.0f, TEST_LOCATION);
DALI_TEST_EQUALS(pivotPoint.y, 0.0f, TEST_LOCATION);
DALI_TEST_EQUALS(pivotPoint.z, 0.5f, TEST_LOCATION);
Vector3 pivot = view.GetPivot();
DALI_TEST_EQUALS(pivot.x, 0.0f, TEST_LOCATION);
DALI_TEST_EQUALS(pivot.y, 0.0f, TEST_LOCATION);
DALI_TEST_EQUALS(pivot.z, 0.5f, TEST_LOCATION);

END_TEST;
}

int UtcDaliViewSetPivotPointP(void)
int UtcDaliViewSetPivotP(void)
{
UiTestApplication application;
View view = View::New();
const Vector3 testPivot(1.0f, 0.0f, 0.5f);

View& result = view.SetPivotPoint(testPivot);
View& result = view.SetPivot(testPivot);
DALI_TEST_EQUALS(&result, &view, TEST_LOCATION);

Vector3 pivotPoint = view.GetPivotPoint();
DALI_TEST_EQUALS(pivotPoint.x, testPivot.x, TEST_LOCATION);
DALI_TEST_EQUALS(pivotPoint.y, testPivot.y, TEST_LOCATION);
DALI_TEST_EQUALS(pivotPoint.z, testPivot.z, TEST_LOCATION);
Vector3 pivot = view.GetPivot();
DALI_TEST_EQUALS(pivot.x, testPivot.x, TEST_LOCATION);
DALI_TEST_EQUALS(pivot.y, testPivot.y, TEST_LOCATION);
DALI_TEST_EQUALS(pivot.z, testPivot.z, TEST_LOCATION);

END_TEST;
}
Expand All @@ -450,13 +450,13 @@ int UtcDaliViewParentOriginChainingP(void)
END_TEST;
}

int UtcDaliViewPivotPointChainingP(void)
int UtcDaliViewPivotChainingP(void)
{
UiTestApplication application;
View view = View::New();
const Vector3 testPivot(1.0f, 1.0f, 1.0f);

View& result = view.SetPivotPoint(testPivot);
View& result = view.SetPivot(testPivot);
DALI_TEST_EQUALS(&result, &view, TEST_LOCATION);

END_TEST;
Expand Down
4 changes: 2 additions & 2 deletions dali-ui-foundation/devel-api/visual-factory/visual-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ namespace Visual
* |-------------------------|-------------------|----------|------------------------|-----------------------------------------------------|
* | offset | VECTOR2 | No | (0,0) | Offset of visual from origin | |
* size | VECTOR2 | No | (1,1) | size of visual | | origin | INTEGER
* or STRING | No | CENTER | origin of the visual @sa Dali::Ui::Align | | anchorPoint
* | INTEGER or STRING | No | CENTER | anchor point of the visual @sa Dali::Ui::Align | |
* or STRING | No | CENTER | origin of the visual @sa Dali::Ui::Align | | pivot
* | INTEGER or STRING | No | CENTER | pivot of the visual @sa Dali::Ui::Align | |
* offsetPolicy | VECTOR2 | No | ( RELATIVE, RELATIVE ) | @sa
* Dali::Ui::Visual::Transform::Policy | | sizePolicy | VECTOR2 | No | ( RELATIVE,
* RELATIVE ) | @sa Dali::Ui::Visual::Transform::Policy |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Dali::Actor CreateOverlayActor()
actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);

actor.SetProperty(Actor::Property::NAME, OVERLAY_NAME);
actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
actor.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
actor.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f));

Expand Down
4 changes: 2 additions & 2 deletions dali-ui-foundation/integration-api/input-field-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ void InputFieldImpl::EnableClipping()
{
// Creates an extra actor to be used as stencil buffer.
mStencil = Actor::New();
mStencil.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
mStencil.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
mStencil.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);

// Enable the clipping property.
Expand All @@ -1289,7 +1289,7 @@ void InputFieldImpl::ResizeActor(Actor& actor, const Vector2& size)
void InputFieldImpl::AddLayer(Actor& layer, Actor& actor)
{
actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
actor.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
Self().Add(actor);
layer = actor;
}
Expand Down
2 changes: 1 addition & 1 deletion dali-ui-foundation/integration-api/view-accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ bool ViewAccessible::GrabHighlight()
SetHighlightActor(highlight);
}

highlight.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
highlight.SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
highlight.SetProperty(Actor::Property::POSITION_Z, 1.0f);
highlight.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));

Expand Down
12 changes: 6 additions & 6 deletions dali-ui-foundation/integration-api/view-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ ViewImpl::~ViewImpl()

void ViewImpl::OnInitialize()
{
Self().SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
Self().SetProperty(Actor::Property::PIVOT, Pivot::TOP_LEFT);
Self().SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
Self().SetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT, false);
Self().SetProperty(Actor::Property::POSITION_USES_PIVOT, false);

DevelActor::ChildOrderChangedSignal(Self()).Connect(this, &ViewImpl::OnChildOrderChanged);
}
Expand Down Expand Up @@ -554,14 +554,14 @@ void ViewImpl::SetParentOrigin(const Vector3& point)
Self().SetProperty(Actor::Property::PARENT_ORIGIN, point);
}

Vector3 ViewImpl::GetPivotPoint() const
Vector3 ViewImpl::GetPivot() const
{
return Self().GetProperty<Vector3>(Actor::Property::ANCHOR_POINT);
return Self().GetProperty<Vector3>(Actor::Property::PIVOT);
}

void ViewImpl::SetPivotPoint(const Vector3& point)
void ViewImpl::SetPivot(const Vector3& point)
{
Self().SetProperty(Actor::Property::ANCHOR_POINT, point);
Self().SetProperty(Actor::Property::PIVOT, point);
}

UiColor ViewImpl::GetBackgroundColor()
Expand Down
8 changes: 4 additions & 4 deletions dali-ui-foundation/integration-api/view-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,14 @@ class DALI_UI_API ViewImpl : public CustomActorImpl, public ConnectionTrackerInt
void SetParentOrigin(const Vector3& point);

/**
* @copydoc Dali::Ui::View::GetPivotPoint
* @copydoc Dali::Ui::View::GetPivot
*/
Vector3 GetPivotPoint() const;
Vector3 GetPivot() const;

/**
* @copydoc Dali::Ui::View::SetPivotPoint
* @copydoc Dali::Ui::View::SetPivot
*/
void SetPivotPoint(const Vector3& point);
void SetPivot(const Vector3& point);

/**
* @copydoc Dali::Ui::View::IsFocusable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ void DragAndDropDetector::OnPan(Dali::Actor actor, const PanGesture& gesture)
mShadowView.SetBackgroundColor(UiColor(0.3f, 0.3f, 0.3f, 0.7f));
mShadowView.SetProperty(Actor::Property::PARENT_ORIGIN,
view.GetCurrentProperty<Vector3>(Actor::Property::PARENT_ORIGIN));
mShadowView.SetProperty(Actor::Property::ANCHOR_POINT,
view.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT));
mShadowView.SetProperty(Actor::Property::PIVOT,
view.GetCurrentProperty<Vector3>(Actor::Property::PIVOT));
view.GetParent().Add(mShadowView);
SetPosition(gesture.GetScreenPosition());
EmitStartedSignal(view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ UNIFORM_BLOCK VisualVertBlock
UNIFORM highp vec2 extraSize;
UNIFORM mediump vec4 offsetSizeMode;
UNIFORM mediump vec2 origin;
UNIFORM mediump vec2 anchorPoint;
UNIFORM mediump vec2 pivot;
};


Expand All @@ -30,7 +30,7 @@ vec4 ComputeVertexPosition()
vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ) + extraSize;
vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
vPosition = aPosition* visualSize;
return vec4( vPosition + anchorPoint*visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 );
return vec4( vPosition + pivot*visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 );
}

void main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ UNIFORM_BLOCK VisualVertBlock
UNIFORM highp vec2 extraSize;
UNIFORM mediump vec4 offsetSizeMode;
UNIFORM mediump vec2 origin;
UNIFORM mediump vec2 anchorPoint;
UNIFORM mediump vec2 pivot;
};

vec2 ComputeVertexPosition()
{
vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ) + extraSize + vec2(0.75, 0.75);
vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
return (aPosition + anchorPoint)*visualSize + visualOffset + origin * uSize.xy;
return (aPosition + pivot)*visualSize + visualOffset + origin * uSize.xy;
}

void main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ UNIFORM_BLOCK VisualVertBlock
UNIFORM highp vec2 extraSize;
UNIFORM mediump vec4 offsetSizeMode;
UNIFORM mediump vec2 origin;
UNIFORM mediump vec2 anchorPoint;
UNIFORM mediump vec2 pivot;
};

vec2 ComputeVertexPosition()
{
vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ) + extraSize;
vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
return (aPosition + anchorPoint)*visualSize + visualOffset + origin * uSize.xy;
return (aPosition + pivot)*visualSize + visualOffset + origin * uSize.xy;
}

void main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ UNIFORM_BLOCK VisualVertBlock
UNIFORM highp vec2 extraSize;
UNIFORM mediump vec4 offsetSizeMode;
UNIFORM mediump vec2 origin;
UNIFORM mediump vec2 anchorPoint;
UNIFORM mediump vec2 pivot;
};

UNIFORM_BLOCK SharedBlock
Expand Down Expand Up @@ -126,7 +126,7 @@ vec4 ComputeVertexPosition()
#endif

#if defined(IS_REQUIRED_CUTOUT)
vPositionFromCenter = vPosition + anchorPoint * visualSize + visualOffset + origin * uSize.xy;
vPositionFromCenter = vPosition + pivot * visualSize + visualOffset + origin * uSize.xy;
#if defined(IS_REQUIRED_ROUNDED_CORNER)
// Reuse each parameters for cutout cases
minSize = min(uSize.x, uSize.y);
Expand All @@ -136,7 +136,7 @@ vec4 ComputeVertexPosition()
#endif
return vec4(vPositionFromCenter, 0.0, 1.0);
#else
return vec4(vPosition + anchorPoint * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0);
return vec4(vPosition + pivot * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0);
#endif
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ UNIFORM_BLOCK VisualVertBlock
UNIFORM highp vec2 extraSize;
UNIFORM mediump vec4 offsetSizeMode;
UNIFORM mediump vec2 origin;
UNIFORM mediump vec2 anchorPoint;
UNIFORM mediump vec2 pivot;
};

#ifdef IS_REQUIRED_BORDERLINE
Expand Down Expand Up @@ -108,7 +108,7 @@ vec4 ComputeVertexPosition()

vTexCoord = (uAlignmentMatrix*vertexPosition.xyw).xy;

return vec4(vPosition + anchorPoint * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0);
return vec4(vPosition + pivot * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0);
}

void main()
Expand Down
Loading
Loading