mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Fire: Ignore mouse events outside the window (to the left)
This fixes a small issue where if you drag the cursor outside the window on the left-hand side, the fire demo will still respond to the mouse events, but wrapped around to the right of the window.
This commit is contained in:
parent
934ea4faf1
commit
739d870091
Notes:
sideshowbarker
2024-07-17 14:36:19 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/739d870091 Pull-request: https://github.com/SerenityOS/serenity/pull/13980
1 changed files with 3 additions and 3 deletions
|
@ -174,9 +174,9 @@ void Fire::mousedown_event(GUI::MouseEvent& event)
|
|||
void Fire::mousemove_event(GUI::MouseEvent& event)
|
||||
{
|
||||
if (dragging) {
|
||||
if (event.y() >= 2 && event.y() < 398 && event.x() <= 638) {
|
||||
int ypos = event.y() / 2;
|
||||
int xpos = event.x() / 2;
|
||||
int ypos = event.y() / 2;
|
||||
int xpos = event.x() / 2;
|
||||
if (bitmap->rect().shrunken(1, 1, 0, 0).contains(xpos, ypos)) {
|
||||
bitmap->scanline_u8(ypos - 1)[xpos] = FIRE_MAX + 5;
|
||||
bitmap->scanline_u8(ypos - 1)[xpos + 1] = FIRE_MAX + 5;
|
||||
bitmap->scanline_u8(ypos)[xpos] = FIRE_MAX + 5;
|
||||
|
|
Loading…
Reference in a new issue