fixes
This commit is contained in:
parent
c84504331b
commit
d26d71ec91
5 changed files with 9 additions and 0 deletions
|
|
@ -41,6 +41,7 @@ void GridElement::UpdatePositionScaled(Window& window) {
|
|||
|
||||
// Calculate position for this child
|
||||
std::int_fast32_t childX = (cellWidth * col) + (spacingX * col) + paddingX;
|
||||
|
||||
std::int_fast32_t childY = (cellHeight * row) + (spacingY * row) + paddingY;
|
||||
|
||||
// Apply relative positioning
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ MouseElement::MouseElement(WindowMouse& window) : Transform({FractionalToMapped(
|
|||
window.mouseElements.push_back(this);
|
||||
}
|
||||
|
||||
MouseElement::MouseElement() : Transform({FractionalToMapped(0), FractionalToMapped(0), FractionalToMapped(1), FractionalToMapped(1), FractionalToMapped(0), FractionalToMapped(0), 0}) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void MouseElement::UpdatePosition(Window& window) {
|
||||
window.ScaleMouse(*this);
|
||||
|
|
|
|||
|
|
@ -522,6 +522,8 @@ void WindowWayland::pointer_handle_button(void* data, wl_pointer* pointer, std::
|
|||
}
|
||||
}
|
||||
window->mouseElements.erase(std::remove(window->mouseElements.begin(), window->mouseElements.end(), static_cast<MouseElement*>(nullptr)), window->mouseElements.end());
|
||||
window->mouseElements.insert(window->mouseElements.end(), window->pendingMouseElements.begin(), window->pendingMouseElements.end());
|
||||
window->pendingMouseElements.clear();
|
||||
}
|
||||
|
||||
void WindowWayland::PointerListenerHandleMotion(void* data, wl_pointer* wl_pointer, uint time, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ export namespace Crafter {
|
|||
Event<MousePoint> onMouseRightRelease;
|
||||
Event<MousePoint> onMouseLeftRelease;
|
||||
|
||||
MouseElement();
|
||||
MouseElement(WindowMouse& window);
|
||||
MouseElement(Anchor anchor);
|
||||
MouseElement(Anchor anchor, WindowMouse& window);
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ export namespace Crafter {
|
|||
bool mouseLeftHeld = false;
|
||||
bool mouseRightHeld = false;
|
||||
std::vector<MouseElement*> mouseElements;
|
||||
std::vector<MouseElement*> pendingMouseElements;
|
||||
};
|
||||
|
||||
class WindowTitle {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue