mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05: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()};
|
||||
|
||||
float scaleX {trans[0].x};
|
||||
float scaleY {trans[1].y};
|
||||
// Make sure nothing renders outside our designated area.
|
||||
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);
|
||||
mRenderer->popClipRect();
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ protected:
|
|||
using List::mWindow;
|
||||
|
||||
using GuiComponent::mDefaultZIndex;
|
||||
using GuiComponent::mOrigin;
|
||||
using GuiComponent::mPosition;
|
||||
using GuiComponent::mZIndex;
|
||||
|
||||
public:
|
||||
|
@ -501,12 +503,11 @@ template <typename T> void CarouselComponent<T>::render(const glm::mat4& parentT
|
|||
return;
|
||||
|
||||
glm::mat4 carouselTrans {parentTrans};
|
||||
carouselTrans =
|
||||
glm::translate(carouselTrans, glm::round(glm::vec3 {mPosition.x, mPosition.y, 0.0f}));
|
||||
carouselTrans = glm::translate(
|
||||
carouselTrans,
|
||||
glm::round(glm::vec3 {GuiComponent::mPosition.x, GuiComponent::mPosition.y, 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}));
|
||||
glm::round(glm::vec3 {mOrigin.x * mSize.x * -1.0f, mOrigin.y * mSize.y * -1.0f, 0.0f}));
|
||||
|
||||
mRenderer->pushClipRect(
|
||||
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.y = Renderer::getScreenHeight() * 0.23240f;
|
||||
GuiComponent::mPosition.x = 0.0f;
|
||||
GuiComponent::mPosition.y = Renderer::getScreenHeight() * 0.38378f;
|
||||
mPosition.x = 0.0f;
|
||||
mPosition.y = Renderer::getScreenHeight() * 0.38378f;
|
||||
mCarouselColor = 0xFFFFFFD8;
|
||||
mCarouselColorEnd = 0xFFFFFFD8;
|
||||
mZIndex = mDefaultZIndex;
|
||||
|
|
Loading…
Reference in a new issue