diff --git a/experimental/Pomdog.Experimental/UI/StackPanel.cpp b/experimental/Pomdog.Experimental/UI/StackPanel.cpp index a2445534c..36cd39332 100644 --- a/experimental/Pomdog.Experimental/UI/StackPanel.cpp +++ b/experimental/Pomdog.Experimental/UI/StackPanel.cpp @@ -102,7 +102,7 @@ void StackPanel::OnPointerMoved(const PointerPoint& pointerPoint) ///@note recalculate position in current coordinate system pointInView = UIHelper::ConvertToChildSpace(pointerPoint.Position, GetGlobalTransform()); - position = Vector2(pointInView.X, pointInView.Y); + position = MathHelper::ToVector2(pointInView); startTouchPoint = position; } } diff --git a/experimental/Pomdog.Experimental/UI/UIHelper.hpp b/experimental/Pomdog.Experimental/UI/UIHelper.hpp index 4c3ff10d2..bbe5942f2 100644 --- a/experimental/Pomdog.Experimental/UI/UIHelper.hpp +++ b/experimental/Pomdog.Experimental/UI/UIHelper.hpp @@ -2,6 +2,7 @@ #pragma once +#include "Pomdog/Math/MathHelper.hpp" #include "Pomdog/Math/Point2D.hpp" #include "Pomdog/Math/Vector2.hpp" #include "Pomdog/Math/Matrix3x2.hpp" @@ -19,8 +20,8 @@ struct UIHelper { static Point2D ConvertToChildSpace( const Point2D& position, const Matrix3x2& transform) { - auto positionInChild = ConvertToChildSpace(Vector2(position.X, position.Y), transform); - return Point2D(positionInChild.X, positionInChild.Y); + auto positionInChild = ConvertToChildSpace(MathHelper::ToVector2(position), transform); + return MathHelper::ToPoint2D(positionInChild); } };