refactor: add GUI instance reference to UI nodes
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace gui;
|
||||
|
||||
Container::Container(glm::vec2 size) : UINode(size) {
|
||||
Container::Container(GUI& gui, glm::vec2 size) : UINode(gui, size) {
|
||||
actualLength = size.y;
|
||||
setColor(glm::vec4());
|
||||
}
|
||||
@@ -41,8 +41,8 @@ std::shared_ptr<UINode> Container::getAt(const glm::vec2& pos) {
|
||||
return UINode::getAt(pos);
|
||||
}
|
||||
|
||||
void Container::mouseMove(GUI* gui, int x, int y) {
|
||||
UINode::mouseMove(gui, x, y);
|
||||
void Container::mouseMove(int x, int y) {
|
||||
UINode::mouseMove(x, y);
|
||||
if (!scrollable) {
|
||||
return;
|
||||
}
|
||||
@@ -65,8 +65,8 @@ void Container::mouseMove(GUI* gui, int x, int y) {
|
||||
prevScrollY = y;
|
||||
}
|
||||
|
||||
void Container::mouseRelease(GUI* gui, int x, int y) {
|
||||
UINode::mouseRelease(gui, x, y);
|
||||
void Container::mouseRelease(int x, int y) {
|
||||
UINode::mouseRelease(x, y);
|
||||
prevScrollY = -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user