You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.0 KiB
C++
57 lines
1.0 KiB
C++
#include "editorwidget.h"
|
|
#include "core/editor.h"
|
|
|
|
EditorWidget::EditorWidget(Callbacks &&callbacks)
|
|
: _input(std::move(callbacks.onInput)),
|
|
_update(std::move(callbacks.onUpdate)),
|
|
_draw(std::move(callbacks.onDisplay))
|
|
{
|
|
}
|
|
|
|
void EditorWidget::input(const kku::SystemEvent &event)
|
|
{
|
|
_input(event);
|
|
}
|
|
|
|
void EditorWidget::update(const kku::microsec &dt)
|
|
{
|
|
_update(dt);
|
|
}
|
|
|
|
void EditorWidget::display() const
|
|
{
|
|
_draw();
|
|
}
|
|
|
|
void EditorWidget::move(const kku::Vector2<float> &delta)
|
|
{
|
|
(void)delta;
|
|
// delegate to children
|
|
}
|
|
|
|
bool EditorWidget::isUnderMouse(const kku::Point &position) const
|
|
{
|
|
return _parent->isUnderMouse(position);
|
|
}
|
|
|
|
void EditorWidget::setRect(const kku::Area<float> &rect)
|
|
{
|
|
(void)rect;
|
|
// basically useless beacuse editor widget fills the entire screen
|
|
}
|
|
|
|
kku::Area<float> EditorWidget::getRect() const
|
|
{
|
|
return {};
|
|
}
|
|
|
|
void EditorWidget::setPosition(const kku::Point &position)
|
|
{
|
|
(void)position;
|
|
}
|
|
|
|
kku::Point EditorWidget::getPosition() const
|
|
{
|
|
return kku::Point{};
|
|
}
|