Change text background to draw item

This commit is contained in:
Dan Paulat 2021-12-18 22:45:29 -06:00
parent 0945eff733
commit 689f3dc464
8 changed files with 24 additions and 113 deletions

View file

@ -67,6 +67,7 @@ public:
void Update();
};
// TODO: OpenGL context with shaders
Rectangle::Rectangle(OpenGLFunctions& gl) :
DrawItem(), p(std::make_unique<RectangleImpl>(gl))
{
@ -159,12 +160,13 @@ void Rectangle::SetFill(boost::gil::rgba8_pixel_t color)
}
}
void Rectangle::SetPosition(float x, float y)
void Rectangle::SetPosition(float x, float y, float z)
{
if (p->x_ != x || p->y_ != y)
if (p->x_ != x || p->y_ != y || p->z_ != z)
{
p->x_ = x;
p->y_ = y;
p->z_ = z;
p->dirty_ = true;
}
}

View file

@ -34,7 +34,7 @@ public:
void SetBorder(float width, boost::gil::rgba8_pixel_t color);
void SetFill(boost::gil::rgba8_pixel_t color);
void SetPosition(float x, float y);
void SetPosition(float x, float y, float z = 0.0f);
void SetSize(float width, float height);
void SetVisible(bool visible);