mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
Fixed a long-standing invalid OpenGL disable in drawRect.
Fixed a really strange bug in ComponentList vertical centering that was causing TextEditComponent to render the top GuiBox border incorrectly with odd sizes.
This commit is contained in:
parent
7c2e7f9069
commit
7cb3cc09ee
|
@ -103,9 +103,9 @@ namespace Renderer {
|
||||||
|
|
||||||
glDrawArrays(GL_TRIANGLES, 0, 6);
|
glDrawArrays(GL_TRIANGLES, 0, 6);
|
||||||
|
|
||||||
glDisableClientState(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
glDisableClientState(GL_VERTEX_ARRAY);
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
glDisable(GL_COLOR_ARRAY);
|
glDisableClientState(GL_COLOR_ARRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMatrix(float* matrix)
|
void setMatrix(float* matrix)
|
||||||
|
|
|
@ -118,7 +118,7 @@ Eigen::Vector3f ComponentListComponent::getCellOffset(Eigen::Vector2i pos)
|
||||||
offset[0] += gridSize.x() - entry->component->getSize().x();
|
offset[0] += gridSize.x() - entry->component->getSize().x();
|
||||||
|
|
||||||
//always center on the Y axis
|
//always center on the Y axis
|
||||||
offset[1] += gridSize.y() / 2 - entry->component->getSize().y() / 2;
|
offset[1] += gridSize.y() / 2.0f - entry->component->getSize().y() / 2.0f;
|
||||||
|
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,13 @@
|
||||||
#include "../Renderer.h"
|
#include "../Renderer.h"
|
||||||
|
|
||||||
TextEditComponent::TextEditComponent(Window* window) : GuiComponent(window),
|
TextEditComponent::TextEditComponent(Window* window) : GuiComponent(window),
|
||||||
mBox(window, 0, 0, 0, 0)
|
mBox(window, 0, 0, 0, 0), mFocused(false)
|
||||||
{
|
{
|
||||||
addChild(&mBox);
|
addChild(&mBox);
|
||||||
|
|
||||||
onFocusLost();
|
onFocusLost();
|
||||||
|
|
||||||
LOG(LogInfo) << getFont()->getHeight();
|
setSize(256, (float)getFont()->getHeight());
|
||||||
setSize(256, /*(float)getFont()->getHeight()*/ 41);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditComponent::onFocusGained()
|
void TextEditComponent::onFocusGained()
|
||||||
|
@ -72,7 +71,7 @@ void TextEditComponent::render(const Eigen::Affine3f& parentTrans)
|
||||||
Renderer::setMatrix(trans);
|
Renderer::setMatrix(trans);
|
||||||
|
|
||||||
std::shared_ptr<Font> f = getFont();
|
std::shared_ptr<Font> f = getFont();
|
||||||
f->drawText(mText, Eigen::Vector2f::Zero(), 0x00000000 | getOpacity());
|
//f->drawText(mText, Eigen::Vector2f::Zero(), 0x00000000 | getOpacity());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Font> TextEditComponent::getFont()
|
std::shared_ptr<Font> TextEditComponent::getFont()
|
||||||
|
|
Loading…
Reference in a new issue