mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 16:15:39 +00:00
Merge pull request #150 from jrassa/render-overflow-fixes
use clip rects to prevent views overflow onto other views
This commit is contained in:
commit
e28e679e2d
|
@ -455,6 +455,7 @@ void SystemView::renderExtras(const Eigen::Affine3f& trans, float lower, float u
|
||||||
else
|
else
|
||||||
extrasTrans.translate(Eigen::Vector3f(0, (i - mExtrasCamOffset) * mSize.y(), 0));
|
extrasTrans.translate(Eigen::Vector3f(0, (i - mExtrasCamOffset) * mSize.y(), 0));
|
||||||
|
|
||||||
|
Renderer::pushClipRect(Eigen::Vector2i(extrasTrans.translation()[0], extrasTrans.translation()[1]), mSize.cast<int>());
|
||||||
SystemViewData data = mEntries.at(index).data;
|
SystemViewData data = mEntries.at(index).data;
|
||||||
for(unsigned int j = 0; j < data.backgroundExtras.size(); j++)
|
for(unsigned int j = 0; j < data.backgroundExtras.size(); j++)
|
||||||
{
|
{
|
||||||
|
@ -463,6 +464,7 @@ void SystemView::renderExtras(const Eigen::Affine3f& trans, float lower, float u
|
||||||
extra->render(extrasTrans);
|
extra->render(extrasTrans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Renderer::popClipRect();
|
||||||
}
|
}
|
||||||
Renderer::popClipRect();
|
Renderer::popClipRect();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,3 +41,11 @@ HelpStyle IGameListView::getHelpStyle()
|
||||||
style.applyTheme(mTheme, getName());
|
style.applyTheme(mTheme, getName());
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IGameListView::render(const Eigen::Affine3f& parentTrans)
|
||||||
|
{
|
||||||
|
Eigen::Affine3f trans = parentTrans * getTransform();
|
||||||
|
Renderer::pushClipRect(Eigen::Vector2i(trans.translation()[0],trans.translation()[1]), Eigen::Vector2i(Renderer::getScreenWidth(), Renderer::getScreenHeight()));
|
||||||
|
renderChildren(trans);
|
||||||
|
Renderer::popClipRect();
|
||||||
|
}
|
||||||
|
|
|
@ -37,6 +37,8 @@ public:
|
||||||
virtual const char* getName() const = 0;
|
virtual const char* getName() const = 0;
|
||||||
|
|
||||||
virtual HelpStyle getHelpStyle() override;
|
virtual HelpStyle getHelpStyle() override;
|
||||||
|
|
||||||
|
void render(const Eigen::Affine3f& parentTrans) override;
|
||||||
protected:
|
protected:
|
||||||
FileData* mRoot;
|
FileData* mRoot;
|
||||||
std::shared_ptr<ThemeData> mTheme;
|
std::shared_ptr<ThemeData> mTheme;
|
||||||
|
|
Loading…
Reference in a new issue