/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Create the scene
PositionSize surfacePositionSize = mSurface->GetPositionSize();
- int windowOrientation = mSurface->GetSurfaceOrientation();
- int screenOrientation = mSurface->GetScreenOrientation();
+ int windowOrientation = mSurface->GetSurfaceOrientation();
+ int screenOrientation = mSurface->GetScreenOrientation();
- mScene = Dali::Integration::Scene::New(Size(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height)), windowOrientation, screenOrientation);
+ mScene = Dali::Integration::Scene::New(Size(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height)), windowOrientation, screenOrientation);
Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
mAdaptor = &adaptorImpl;
timeStamp = TimeService::GetMilliSeconds();
}
- RecalculateTouchPosition(point);
+ Vector2 convertedPosition = RecalculatePosition(point.GetScreenPosition());
+ point.SetScreenPosition(convertedPosition);
Integration::TouchEvent touchEvent;
Integration::HoverEvent hoverEvent;
// Keep the handle alive until the core events are processed.
Dali::BaseHandle sceneHolder(this);
+ Vector2 convertedPosition = RecalculatePosition(wheelEvent.point);
+ wheelEvent.point = convertedPosition;
+
mScene.QueueEvent(wheelEvent);
mAdaptor->ProcessCoreEvents();
}
virtual void OnResume(){};
/**
- * Recalculate the touch position if required
- * @param[in,out] point The touch point
+ * Recalculate the position if required
+ * @param[in] position The screen position
+ * @return converted position by oriention
*/
- virtual void RecalculateTouchPosition(Integration::Point& point){};
+ virtual Vector2 RecalculatePosition(const Vector2& position)
+ {
+ return position;
+ };
private:
/**
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return;
}
- RecalculateTouchPosition(point);
+ Vector2 convertedPosition = RecalculatePosition(point.GetScreenPosition());
+ point.SetScreenPosition(convertedPosition);
+
Dali::TouchEvent touchEvent = Dali::Integration::NewTouchEvent(timeStamp, point);
Dali::GlWindow handle(this);
mTouchedSignal.Emit(touchEvent);
}
}
-void GlWindow::RecalculateTouchPosition(Integration::Point& point)
+Vector2 GlWindow::RecalculatePosition(const Vector2& position)
{
- Vector2 position = point.GetScreenPosition();
Vector2 convertedPosition;
switch(mTotalRotationAngle)
break;
}
}
-
- point.SetScreenPosition(convertedPosition);
+ return convertedPosition;
}
void GlWindow::SetAvailableAnlges(const std::vector<int>& angles)
#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void SetEventHandler();
/**
- * @brief calculate touch position for rotation.
+ * @brief calculate screen position for rotation.
*/
- void RecalculateTouchPosition(Integration::Point& point);
+ Vector2 RecalculatePosition(const Vector2& position);
/**
* @brief Sets window and class name.
void Window::OnIconifyChanged(bool iconified)
{
- const bool isActuallyChanged = (iconified != mIconified);
- auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge();
+ const bool isActuallyChanged = (iconified != mIconified);
+ auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge();
Dali::Window handle(this);
if(iconified)
if(isActuallyChanged)
{
- auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge();
+ auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge();
Dali::Window handle(this);
if(maximized)
bridge->RemoveTopLevelWindow(accessible);
}
-void Window::RecalculateTouchPosition(Integration::Point& point)
+Vector2 Window::RecalculatePosition(const Vector2& position)
{
- Vector2 position = point.GetScreenPosition();
Vector2 convertedPosition;
switch(mRotationAngle)
break;
}
}
-
- point.SetScreenPosition(convertedPosition);
+ return convertedPosition;
}
Dali::Window Window::Get(Dali::Actor actor)
void OnResume() override;
/**
- * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculateTouchPosition
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculatePosition
*/
- void RecalculateTouchPosition(Integration::Point& point) override;
+ Vector2 RecalculatePosition(const Vector2& position) override;
private: // Dali::Internal::Adaptor::EventHandler::Observer
/**