mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 22:25:38 +00:00
Some minor code cleanup.
This commit is contained in:
parent
4610e91bd7
commit
8d5dc46fc6
|
@ -366,15 +366,12 @@ void GamelistView::render(const glm::mat4& parentTrans)
|
||||||
{
|
{
|
||||||
glm::mat4 trans {parentTrans * getTransform()};
|
glm::mat4 trans {parentTrans * getTransform()};
|
||||||
|
|
||||||
float scaleX {trans[0].x};
|
// Make sure nothing renders outside our designated area.
|
||||||
float scaleY {trans[1].y};
|
mRenderer->pushClipRect(
|
||||||
|
glm::ivec2 {static_cast<int>(std::round(trans[3].x)),
|
||||||
|
static_cast<int>(std::round(trans[3].y))},
|
||||||
|
glm::ivec2 {static_cast<int>(std::round(mSize.x)), static_cast<int>(std::round(mSize.y))});
|
||||||
|
|
||||||
glm::ivec2 pos {static_cast<int>(std::round(trans[3].x)),
|
|
||||||
static_cast<int>(std::round(trans[3].y))};
|
|
||||||
glm::ivec2 size {static_cast<int>(std::round(mSize.x * scaleX)),
|
|
||||||
static_cast<int>(std::round(mSize.y * scaleY))};
|
|
||||||
|
|
||||||
mRenderer->pushClipRect(pos, size);
|
|
||||||
renderChildren(trans);
|
renderChildren(trans);
|
||||||
mRenderer->popClipRect();
|
mRenderer->popClipRect();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@ protected:
|
||||||
using List::mWindow;
|
using List::mWindow;
|
||||||
|
|
||||||
using GuiComponent::mDefaultZIndex;
|
using GuiComponent::mDefaultZIndex;
|
||||||
|
using GuiComponent::mOrigin;
|
||||||
|
using GuiComponent::mPosition;
|
||||||
using GuiComponent::mZIndex;
|
using GuiComponent::mZIndex;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -501,12 +503,11 @@ template <typename T> void CarouselComponent<T>::render(const glm::mat4& parentT
|
||||||
return;
|
return;
|
||||||
|
|
||||||
glm::mat4 carouselTrans {parentTrans};
|
glm::mat4 carouselTrans {parentTrans};
|
||||||
|
carouselTrans =
|
||||||
|
glm::translate(carouselTrans, glm::round(glm::vec3 {mPosition.x, mPosition.y, 0.0f}));
|
||||||
carouselTrans = glm::translate(
|
carouselTrans = glm::translate(
|
||||||
carouselTrans,
|
carouselTrans,
|
||||||
glm::round(glm::vec3 {GuiComponent::mPosition.x, GuiComponent::mPosition.y, 0.0f}));
|
glm::round(glm::vec3 {mOrigin.x * mSize.x * -1.0f, mOrigin.y * mSize.y * -1.0f, 0.0f}));
|
||||||
carouselTrans = glm::translate(
|
|
||||||
carouselTrans, glm::round(glm::vec3 {GuiComponent::mOrigin.x * mSize.x * -1.0f,
|
|
||||||
GuiComponent::mOrigin.y * mSize.y * -1.0f, 0.0f}));
|
|
||||||
|
|
||||||
mRenderer->pushClipRect(
|
mRenderer->pushClipRect(
|
||||||
glm::ivec2 {static_cast<int>(glm::clamp(std::round(carouselTrans[3].x), 0.0f,
|
glm::ivec2 {static_cast<int>(glm::clamp(std::round(carouselTrans[3].x), 0.0f,
|
||||||
|
@ -746,8 +747,8 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
||||||
|
|
||||||
mSize.x = Renderer::getScreenWidth();
|
mSize.x = Renderer::getScreenWidth();
|
||||||
mSize.y = Renderer::getScreenHeight() * 0.23240f;
|
mSize.y = Renderer::getScreenHeight() * 0.23240f;
|
||||||
GuiComponent::mPosition.x = 0.0f;
|
mPosition.x = 0.0f;
|
||||||
GuiComponent::mPosition.y = Renderer::getScreenHeight() * 0.38378f;
|
mPosition.y = Renderer::getScreenHeight() * 0.38378f;
|
||||||
mCarouselColor = 0xFFFFFFD8;
|
mCarouselColor = 0xFFFFFFD8;
|
||||||
mCarouselColorEnd = 0xFFFFFFD8;
|
mCarouselColorEnd = 0xFFFFFFD8;
|
||||||
mZIndex = mDefaultZIndex;
|
mZIndex = mDefaultZIndex;
|
||||||
|
|
Loading…
Reference in a new issue