ToggleButton fix
This commit is contained in:
parent
e89b6f5c4c
commit
88491ffbd8
|
@ -1,3 +1,3 @@
|
||||||
Name: UI Test
|
Name: UI Test
|
||||||
ID: 96041206
|
ID: 88543249
|
||||||
Type: 5
|
Type: 5
|
||||||
|
|
|
@ -161,7 +161,9 @@ namespace SHADE
|
||||||
windowSize = SHEditorWindowManager::GetEditorWindow<SHEditorViewport>()->windowSize;
|
windowSize = SHEditorWindowManager::GetEditorWindow<SHEditorViewport>()->windowSize;
|
||||||
mousePos = SHEditorWindowManager::GetEditorWindow<SHEditorViewport>()->viewportMousePos;
|
mousePos = SHEditorWindowManager::GetEditorWindow<SHEditorViewport>()->viewportMousePos;
|
||||||
//mousePos.y = windowSize.y - mousePos.y;
|
//mousePos.y = windowSize.y - mousePos.y;
|
||||||
|
SHLOG_INFO("mouse pos: {}, {}", mousePos.x, mousePos.y)
|
||||||
mousePos /= windowSize;
|
mousePos /= windowSize;
|
||||||
|
SHLOG_INFO("mouse pos normalized: {}, {}", mousePos.x, mousePos.y)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SHVec2 camSize{ cameraSystem->GetCameraWidthHeight(0)};
|
SHVec2 camSize{ cameraSystem->GetCameraWidthHeight(0)};
|
||||||
|
@ -169,6 +171,7 @@ namespace SHADE
|
||||||
|
|
||||||
topExtent = CanvasToScreenPoint(topExtent);
|
topExtent = CanvasToScreenPoint(topExtent);
|
||||||
btmExtent = CanvasToScreenPoint(btmExtent);
|
btmExtent = CanvasToScreenPoint(btmExtent);
|
||||||
|
//SHLOG_INFO("TopExtent: {}, {} Btm Extent: {}, {}", topExtent.x, topExtent.y, btmExtent.x, btmExtent.y)
|
||||||
topExtent /= camSize;
|
topExtent /= camSize;
|
||||||
btmExtent /= camSize;
|
btmExtent /= camSize;
|
||||||
|
|
||||||
|
@ -210,8 +213,9 @@ namespace SHADE
|
||||||
auto cameraSystem = SHSystemManager::GetSystem<SHCameraSystem>();
|
auto cameraSystem = SHSystemManager::GetSystem<SHCameraSystem>();
|
||||||
auto uiComp = SHComponentManager::GetComponent<SHUIComponent>(comp.GetEID());
|
auto uiComp = SHComponentManager::GetComponent<SHUIComponent>(comp.GetEID());
|
||||||
|
|
||||||
SHVec4 topExtent4 = uiComp->GetMatrix() * SHVec4(-comp.size.x * 0.5f, comp.size.y * 0.5f, 0.0f, 1.0f);
|
SHVec4 topExtent4 = SHMatrix::Translate(-comp.size.x * 0.5f, comp.size.y * 0.5f, 0.0f) * uiComp->GetMatrix() * SHVec4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
SHVec4 btmExtent4 = uiComp->GetMatrix() * SHVec4(comp.size.x * 0.5f, -comp.size.y * 0.5f, 0.0f, 1.0f);
|
SHVec4 btmExtent4 = SHMatrix::Translate(comp.size.x * 0.5f, -comp.size.y * 0.5f, 0.0f) * uiComp->GetMatrix() * SHVec4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
|
|
||||||
SHVec2 topExtent{ topExtent4.x,topExtent4.y };
|
SHVec2 topExtent{ topExtent4.x,topExtent4.y };
|
||||||
SHVec2 btmExtent{ btmExtent4.x,btmExtent4.y };
|
SHVec2 btmExtent{ btmExtent4.x,btmExtent4.y };
|
||||||
|
|
Loading…
Reference in New Issue