Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions source/gui/mostlyharmless_WebviewEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ namespace mostly_harmless::gui {
return {};
};

auto cacheCursorDownPositionCallback_ = [this](const choc::value::ValueView& args) -> choc::value::Value {
auto cacheCursorDownPositionCallback_ = [this](const choc::value::ValueView& /*args*/) -> choc::value::Value {
std::uint32_t x, y;
cursor::getCursorPosition(&x, &y);
m_cursorState.lastMouseDownLocation = std::make_pair(x, y);
return {};
};

auto beginScopedCursorMoveGestureCallback_ = [this](const choc::value::ValueView& args) -> choc::value::Value {
auto beginScopedCursorMoveGestureCallback_ = [this](const choc::value::ValueView& /*args*/) -> choc::value::Value {
std::uint32_t x, y;
cursor::getCursorPosition(&x, &y);
m_cursorState.lastMouseDownLocation = std::make_pair(x, y);
cursor::setCursorState(false);
return {};
};

auto endScopedCursorMoveGestureCallback_ = [this](const choc::value::ValueView& args) -> choc::value::Value {
auto endScopedCursorMoveGestureCallback_ = [this](const choc::value::ValueView& /*args*/) -> choc::value::Value {
mostly_harmless::utils::OnScopeExit se{ [this]() -> void {
cursor::setCursorState(true);
} };
Expand All @@ -73,14 +73,14 @@ namespace mostly_harmless::gui {
return {};
};

auto resetCursorPositionCallback_ = [this](const choc::value::ValueView& args) -> choc::value::Value {
auto resetCursorPositionCallback_ = [this](const choc::value::ValueView& /*args*/) -> choc::value::Value {
const auto [x, y] = m_cursorState.lastMouseDownLocation.value_or(std::make_pair(0, 0));
mostly_harmless::gui::cursor::setCursorPosition(x, y);
m_cursorState.lastMousePosition = std::make_pair(x, y);
return {};
};

auto tickCursorMoveCallback_ = [this](const choc::value::ValueView& args) -> choc::value::Value {
auto tickCursorMoveCallback_ = [this](const choc::value::ValueView& /*args*/) -> choc::value::Value {
const auto lastMouseDownLocation = m_cursorState.lastMouseDownLocation.value_or(std::make_pair(0, 0));
const auto [prevX, prevY] = m_cursorState.lastMousePosition.value_or(lastMouseDownLocation);
std::uint32_t x, y;
Expand All @@ -92,7 +92,7 @@ namespace mostly_harmless::gui {
return res;
};

auto clearPreviousCursorPositionCallback_ = [this](const choc::value::ValueView& args) -> choc::value::Value {
auto clearPreviousCursorPositionCallback_ = [this](const choc::value::ValueView& /*args*/) -> choc::value::Value {
m_cursorState.lastMousePosition = {};
m_cursorState.lastMouseDownLocation = {};
return {};
Expand Down
Loading